2 min lesson
The canonical use case: PII / secret block
Connect "The headline hook is a prompt-submit scan" to the decision you would make.
Step 1 of 2
The headline hook is a prompt-submit scan: inspect every prompt for PIIPersonally Identifiable Information. Data that can identify a person (names, emails, SSNs); regulated and sensitive. Press Enter for the full definition., API keys or secrets and, if any is found, halt the prompt before it ever reaches the model and return a custom error. The same logic blocks 'no private keys' before any agent change lands. This is deterministic DLP - it happens whether or not the model would have 'known better' - which is exactly the assurance a security or controls owner wants beside your gates.
Hooks came from enterprise customers' bespoke requirements: rather than Cursor building everyone's one-off control, hooks let any team extend Cursor themselves. A before-prompt hook can also audit which rules were actually in context, turning 'are our standards being followed?' into a logged fact.
Hooks sit alongside the rest of Cursor's enterprise control surface - SSOSingle Sign-On. One company login (usually via SAML or OIDC) instead of a separate password per tool. Press Enter for the full definition. (SAMLSecurity Assertion Markup Language. The XML-era enterprise standard that powers single sign-on: your identity provider vouches for you to each app. Older than OIDC but still what many enterprise tools speak. Press Enter for the full definition./OIDCOpenID Connect. The modern single sign-on standard, built as an identity layer on top of OAuth 2.0. Where SAML is XML and enterprise-legacy, OIDC is JSON and what newer tools implement first. Press Enter for the full definition.), SCIMSystem for Cross-domain Identity Management. A standard for automatically creating and removing user accounts when people join or leave. Press Enter for the full definition., RBACRole-Based Access Control. Granting permissions by role rather than configuring each person individually. Press Enter for the full definition., model/MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition./repo allowlists, terminal sandboxing, audit logs and AI-code tracking - and admins can push them (plus skills and MCP integrations) centrally to the whole team and see invocation analytics. They run in cloud agents as well as the IDE/CLI.
"Your gates assert what passes. Hooks are the deterministic layer underneath them - real code at fixed lifecycle points that can scan a prompt for secrets and halt before the model sees it. Build it once, push it to the team and it runs in cloud agents too."