AI agent governance helps you control and trace what agents do with production credentials. If an agent can issue refunds, deploy code, or change customer records, you need to know what it can access, who approved sensitive actions, and how to stop it.
Copy link to headingWhat is AI agent governance?
AI agent governance defines what an agent can do and which permissions it can use. Model governance asks whether an output is safe and accurate. Agent governance asks whether the agent should have written to a database, issued a refund, or deployed code. These controls can help meet the logging and human oversight duties the EU AI Act sets for covered high-risk systems.
A read-only agent can leak data. An agent with write access can also make unauthorized changes. Validate tool requests for both, and add controls based on what each write can change:
If your agent falls into either of the last two rows, start with these prerequisites.
Copy link to headingWhat you need before implementing AI agent governance
Before you start, make sure your team has these five things:
Identity provider: Issue and revoke agent identities, and link each one to a named owner. Single sign-on (SSO) and directory sync can help manage owner access.
Model gateway: Control which models agents can use, set spending limits, and log requests.
Log sink: A security information and event management (SIEM) system or another log store outside the agent's reach.
Named owners: Assign one person to answer for each agent during an incident.
Risk-tier scheme: Agree with security and product on which actions are read-only, which are low-risk writes, and which are high-risk writes.
The National Institute of Standards and Technology (NIST) AI Risk Management Framework (AI RMF) calls for keeping an AI inventory and documenting who does what.
Copy link to headingStep 1: Inventory every AI agent, its tools, and its owner
You can't limit an agent's access, gate its actions, log its calls, or revoke its credentials if you don't know it exists. Incident response inventories can miss agent credentials. Record what each agent does, where it runs, which tools and Model Context Protocol (MCP) servers it can call, and what data it reads and writes. List each credential's scope and expiration. Name one owner for changes and incidents.
Check gateway logs, OAuth grants, and continuous integration (CI) secrets for signs of agents missing from the registry. Look for entries whose owners have left. When you retire an agent, revoke its credentials and close its entry. Keep a version history of the registry and name an owner on every row.
Copy link to headingStep 2: Give each AI agent a scoped non-human identity
Providers typically attribute calls made with a developer's personal token to that developer. Give each agent its own non-human identity so you can trace its calls and revoke access without disrupting other agents. The Open Worldwide Application Security Project (OWASP) agent security guidance recommends limiting what tools can do and how often they can run. Record each tool's scopes, rate limit, and allowed outbound destinations. At Rillet, the team attaches reusable Slack and Linear connections to the Vercel projects that need them. Vercel Connect issues short-lived tokens at runtime, so apps don't store long-lived provider secrets. Track permissions delegated by a user separately from the agent's own identity.
Under the MCP authorization specification, clients include the intended server's canonical URI in the resource parameter of authorization and token requests. Servers reject tokens issued for another audience. Match scopes to data classification. An agent cleared for internal docs still needs permission to read customer records. Use role-based access control (RBAC) to separate connector and budget management from deployment. For each agent, record its identity, scopes, and expiration. Note who can revoke access.
Copy link to headingStep 3: Gate high-risk agent actions with human approval
Approving every write can slow routine work. Without a gate, an agent can make irreversible changes on its own. Decide which writes need review based on their impact and whether you can reverse them. These tiers are separate from the EU AI Act's legal high-risk category:
Deny calls to tools outside the agent's registry entry and actions the policy can't classify. For permitted actions with high-risk arguments, such as a large refund, use AI SDK 7 tool approvals to ask a reviewer before a locally executed tool runs. Set the tool's approval status to 'user-approval' in toolApproval.
The human-in-the-loop guide shows how Workflow SDK and Chat SDK pause a run until a reviewer responds or the request times out.
Copy link to headingStep 4: Log every agent tool call for audit
Record the agent ID, version, caller, tool, model, timestamp, and request ID. Keep enough redacted input and output to reconstruct the action. Leave out credentials and unnecessary personal data. Send records to a store the agent can't modify. For a refund, check Agent Runs for what the eve agent tried, the app's approval record for who authorized it, and the payment provider's transaction record for whether it went through. Use the same request or tool-call ID across app records. Save the provider's transaction ID when available.
For covered high-risk systems, Article 26(6) requires deployers to keep automatically generated logs under their control for at least six months, unless applicable EU or national law says otherwise. The Annex III rules apply from December 2, 2027. Make sure you can export the audit trail and search by agent, requester, and date. The agent auditing guide explains how to match app records to what happened in the target system. Use Audit Log Drains for Vercel team activity, such as changes to project settings.
Copy link to headingStep 5: Control AI agent model access and spend
Model calls cost money and send data to providers. Route calls through a gateway to control model access and track costs. Block unvetted models with an allowlist and send spending alerts to the agent owner. If the agent has its own Vercel project, authenticate to AI Gateway with the deployment's short-lived OpenID Connect (OIDC) token and set a project budget. The budget covers eligible AI Gateway charges from the project's deployment tokens. You don't need to store an API key.
Cap steps per run and retries per call. Stop or escalate when the agent hits either cap. Use rate limits to control how many calls it makes in a given period. If agents share a project, use each agent's ID as an AI Gateway reporting tag to match charges to the registry. Tags break down costs by agent. The budget still applies to the project.
Copy link to headingStep 6: Isolate agent code and contain prompt injection
Keep application secrets out of the environment where you run code an agent writes or downloads. OWASP's Agentic Top 10 includes unexpected code execution. Standard containers share the host kernel, so a container escape can expose the host. Notion Workers run untrusted code in separate Vercel Sandbox microVMs, each with its own guest kernel. gVisor's application kernel instead intercepts system calls in user space.
Isolation doesn't prevent prompt injection. A model can still follow instructions in the content it reads. Treat external content as untrusted and validate tool arguments in code. Set separate security boundaries for the agent runtime and the code it generates. Broker credentials outside the sandbox to keep raw secrets out. The receiving service still checks permissions even if the firewall allows the call. In your isolation policy, list the runtime, allowed destinations, and accessible credentials.
Copy link to headingStep 7: Build an agent kill switch and incident runbook
Build and test a kill switch before you need it. The AI RMF calls for ways to deactivate systems. Article 14 calls for safe interruption where appropriate. In staging, trigger the switch with work queued and running. Block new runs and cancel queued and active work. With Workflow SDK cancellation, running steps must check the abort signal or pass it to an API that supports it. Cut off downstream access and revoke the agent's gateway key if it uses one. For Vercel Connect, detach the connector and check that the test project can't request a new token.
Check that no new runs start and that active runs either stop or can no longer act. If the provider supports token revocation, revoke an existing token and check that the provider rejects it. Otherwise, record how long the token still works and what could cut off access sooner. Time the drill from activation to the last confirmed denial. Note any work that continued. In an incident, save logs and approval records before cleanup. Instant Rollback restores a previous deployment without a rebuild. Handle data changes and migrations separately. Close with a timeline, root cause, and changes to risk tiers, scopes, or budgets.
Copy link to headingCommon AI agent governance failure modes
Check for these failure modes during rollout:
Orphaned agents: Removing the owner's account leaves the agent's tokens active because the registry doesn't connect to identity and access management (IAM).
Shared long-lived keys: Revoking a shared key disrupts every agent that uses it. The key alone can't tell you what each agent spent.
Approval fatigue: When reviewers get too many requests for low-risk actions, they can miss the ones that need a closer look.
Logs missing decision context: Without the details behind a policy decision, reviewers may not know whether the action stayed in scope.
Uncapped retries: Without a retry or step limit, a failed call can trigger more model calls and drive up costs.
Review the metrics regularly and send alerts if spending or retries spike during a run.
Copy link to headingHow to verify AI agent governance works
Review these five metrics monthly. Set thresholds based on what's normal for each agent and what its actions can affect:
These examples show how operational controls relate to the NIST AI RMF, the EU AI Act, and OWASP guidance. They do not establish compliance.
The OWASP examples draw on its guidance for agents, large language models (LLMs), and non-human identities. The NIST references use AI RMF 1.0. NIST is revising the framework, so check which version your organization uses before citing the subcategories in an audit.
Copy link to headingHow Vercel helps platform teams govern AI agents in production
Your team owns the registry and sets the risk tiers. Use the product details below to choose settings for your deployment.
Copy link to headingCap model access and spend with AI Gateway
An agent stuck in a loop can run up costs before anyone checks the dashboard. Set AI Gateway budgets for a team, project, API key, or team member. At the limit, AI Gateway rejects new requests with HTTP 402 and quota_for_entity_exceeded. Email alerts are optional at 50%, 75%, and 100%. AI Gateway checks before each request, so the request that exceeds the limit can still finish. Charges paid through your own provider keys generally don't count toward these budgets. The bring-your-own-key (BYOK) fee for turning off fallback does.
On Pro and Enterprise, you can turn on the model allowlist. AI Gateway returns HTTP 403 for unapproved models unless the key is exempt. If you enable Zero Data Retention, AI Gateway routes requests based on providers' retention commitments. It skips your provider keys by default unless you mark them as covered by your own provider agreement.
Copy link to headingRun agent code in isolated Vercel Sandbox microVMs
Code an agent generates is untrusted, even if it needs an authenticated API. Vercel Sandbox gives each sandbox a Firecracker microVM with its own filesystem and network. With credential brokering, the firewall adds credentials to approved outbound requests without exposing the secret to the code.
The default network policy is allow-all. Use deny-all when the code needs no network access. If it needs to call specific services, set an allowlist and broker credentials for those destinations. Enterprise teams can attach a sandbox to a Secure Compute network and reach private resources through VPC peering.
Copy link to headingIssue short-lived, scoped credentials with Vercel Connect
Vercel Connect is available on all plans. An authorized deployment can use its Vercel OIDC identity to request provider access at runtime. Supported OAuth connectors give the app an access token and keep the refresh token out of its code. API-key connectors use the key the connector owner supplies. You still need to rotate those keys.
Connect supports APIs and MCP client integrations. The Connector Manager permission lets designated team members create and manage connectors. Enterprise teams can use Security Assertion Markup Language (SAML) sign-in and Directory Sync to manage agent owners' Vercel access through their identity provider.
Copy link to headingAudit and observe agent activity
On Enterprise, Audit Log Drains send supported team events to HTTPS endpoints, Amazon S3, or Splunk. Each event identifies the actor and can include the IP address, user agent, and request ID when available.
During beta, Agent Runs keeps eve traces for 30 days on all plans. Store approval records yourself, along with any logs you need to keep longer. You can configure monitors in Alerts to send anomaly alerts by email, Slack, or webhook.
Copy link to headingPut governed agents into production on Vercel
Use the registry to record which controls apply to each agent and what you verified in the first drill.
Add these details to the agent's registry entry:
Owner: Who can change the agent's policy and who responds if it misbehaves.
Access: Which identities, tools, and environments the agent can use.
Approval: Which action you tested, who could authorize it, and what happened on timeout.
Evidence: Where to find the approval decision and confirm what happened in the target system.
Revocation: How long it took to cut off access and whether anything kept running or retained access.
Pick one agent that can write to a production system. See the human review guide to learn about human approvals for high-risk actions. In staging, record the approval decision and what happened. Then time how long it takes to stop the agent and cut off its access.
Copy link to headingFrequently asked questions about AI agent governance
Copy link to headingDoes the EU AI Act apply to internal AI agents?
Using an AI system internally doesn't automatically exempt it. Classification depends on its intended use and Article 6. Annex III covers uses such as screening job applicants, assigning tasks based on personal characteristics or behavior, and assessing a person's creditworthiness. Its rules apply from December 2, 2027. Annex III systems that profile people are always high-risk.
Copy link to headingHow do you govern third-party agents you didn't build?
Use the vendor contract and the access grants you control. Require the vendor to export logs to your security information and event management (SIEM) system and notify you before adding tools. Match access scopes to the vendor's documented tools. When you stop using the agent, revoke each OAuth grant or other credential the agent uses, then confirm the agent no longer has access.
Copy link to headingHow long does an AI agent governance rollout take?
That depends on how many credentials you need to replace and how easily you can revoke them. If a provider only offers static API keys, set a rotation schedule and use a broker for the keys. Start with agents that can change production systems or customer data.
Copy link to headingDo coding agents need different governance than production agents?
Yes. Coding agents run shell and infrastructure commands. Keep production cloud credentials out of their environments and require human approval before they run destructive commands such as terraform destroy.