Security boundaries in agentic architectures

A model can produce the right answer and still operate without enough restrictions to prevent an unauthorized action. Protection does not reside in the prompt. It depends on access controls and tests that show, along specific paths, where an attempt was accepted or denied.
Key facts about AI agent security boundaries
- Vercel's analysis distinguishes four components: the agent, its credentials, generated code and the filesystem where it runs.
- A shared sandbox can isolate external infrastructure without separating the agent from the code it generates.
- Credential injection at egress reduces exposure of the raw value when the proxy is configured correctly. It does not prevent every misuse or instance of data exfiltration.
- A boundary requires both denial and authorized access tests, with evidence of the component that made each decision.
The incident that was not caused by the model
A production agent can fail because of a model error, but the trust boundary determines how far that failure can reach. When the agent, its generated code and credentials share the same security context, prompt injection can turn into unauthorized access. The system must be able to stop that action.
The boundary must be verifiable. Vercel's 2026 technical analysis of security boundaries in agentic architectures distinguishes the agent, credentials, generated code and filesystem, and examines the risks of giving them a shared access context. Untrusted content can influence generated code. If the environment permits it, that code can reach resources intended for the service. The analysis describes a risk; it does not establish that an exfiltration incident occurred. A stricter prompt does not replace auditable runtime controls. A sandbox that isolates external infrastructure does not demonstrate separation between generated code and harness files. Teams must test both a forbidden file read and an allowed connection under known conditions. Each result should identify the component that accepted or denied the attempt, since a network denial does not prove authorization at the service. The discussion of agent call governance adds context to that distinction.
| Boundary | Question it answers | Control point | Test of selected paths |
|---|---|---|---|
| Execution | Where the agent runs and what it can reach on the network | Separate contexts for the harness and generated code, with controlled network access | Confirm that forbidden reads and connections are denied and an authorized connection works |
| Credential | Which identity the agent assumes and for how long | Service identity, short-lived credential and task-specific scope | Check scope, expiration and revocation using a synthetic credential |
| Tool | Which call is allowed and which requires human approval | Argument schema and separate authorization by identity, resource and action | Through the gateway, test forbidden and permitted actions with valid arguments; if the service is reserved for the gateway, block direct access; if direct access is authorized, test both actions there |
| Inference | Which model handles each request, under what budget cap and with what audit trail | Policy for approved models, budget and decision logging | Verify denial of an unapproved model and successful handling by an authorized model |
Figure sources: OWASP Authorization Cheat Sheet, supplemented by RFCs 8693, 8705 and 9449 and NIST SP 800-207 cited in the text. The figure describes controls to test, not verified product capabilities.
Execution boundary: where the agent runs and what it can reach on the network
The execution boundary determines the computing context in which the agent runs and what it can reach on the network. The control point is separation between the harness, which holds credentials, and the code the agent generates, with access restrictions verified in the deployment before the system goes into production.
The harness is reviewed production software. Received text can change the agent's decisions. A shared sandbox can limit external access, but it does not automatically separate its components. If generated code can read harness credentials, the internal boundary has failed. Run the harness and generated code in separate contexts, for example an ephemeral VM per execution. The VM alone does not guarantee isolation: permissions, volumes, networking, host access and state disposal must be configured and verified. A new execution should start without files left by the previous one. Network policy combines allowed egress destinations, a block on the metadata address and a proxy that injects the credential for the authorized destination. If all egress passes through the proxy, with destination validation and protected injection, the code does not need the raw credential value. This reduces its exposure, but does not prevent every instance of exfiltration or misuse of an allowed call.
Credential boundary: agent identity, token lifetime and blast radius
The credential boundary defines which identity the agent assumes, how long it holds that identity and what it can access. A broker can issue credentials with task-specific scope and a short lifetime. Egress injection can keep raw credentials away from the model and generated code, provided the architecture enforces that separation.
Using an analyst's personal token blurs accountability: the agent can inherit unnecessary permissions, and logs can attribute its actions to that person. A service identity identifies the agent; the token is the credential used to gain access. Authorized work should be limited and logged, as discussed in agent credentials and key-based management. Use a task token, not a platform token. A short lifetime reduces exposure but does not prevent reuse while the token remains valid. Replay protection requires an additional control. OAuth 2.0 Token Exchange, defined in RFC 8693, allows tokens to be exchanged and describes delegation and impersonation. The act claim can represent the actor and delegation chain when the issuer's policy uses it; the standard does not guarantee a short lifetime or an audit trail. During token exchange, the operation validates subject, actor and audience under its policy. Scope is mandatory: missing scope or another required attribute results in denial.
Tool boundary: per-call permission and human approval
The tool boundary defines which calls the agent can make, which arguments it can use and which calls require human approval. A schema validates the shape and types of arguments; it does not decide authorization. A separate policy, enforced outside the model and in the service that produces the effect, checks identity, client, resource and operation.
Reads need protection against unauthorized access; reversible writes require validation and idempotency. For irreversible actions, such as moving money, deleting a record, changing permissions or publishing externally, policy can require human approval for each call, with the exact payload visible to the approver. Approving the plan is not enough. Bind approval to the approver, action, resource and payload, with an expiration and single use. The service revalidates authorization and the approval match before the effect. The log correlates approver, decision and outcome. It does not store the raw payload by default. The operating contract for long-running agents covers idempotency and approval stops. Tool descriptions are inputs too: an unreviewed external MCP server or catalog description can influence the agent. A versioned registry, review and environment-specific tool limits reduce that surface. See also guardrails for tools and data in production and agent plugin permissions.
Inference boundary: routing, spending cap and per-request audit
The inference boundary determines which model handles each request, where context is sent, what spending cap applies and what record remains. The operation must define approved models and destinations, identify the component that enforces the policy, and specify how its decision will be logged and tested in the actual deployment.
With remote inference, context leaves the agent process for the inference service: it can include the prompt, documents, schema or logs. The destination can be inside or outside the organization. Local inference does not require sending data to an external provider, but deployment communications and telemetry still need examination. The choice determines who processes the data and under which retention policy. The operation should require approved models by key or project and verify denials outside the list, including fallback and alternative paths. Model switching depends on managed policy, not just the agent loop. An agent stuck in a loop can keep consuming resources until a limit intervenes. The team should configure an appropriate cap and test whether the deployment denies new calls when it is reached. A configurable budget does not prove fail-closed behavior. Test the actual route and record the result rather than assuming that the configured limit blocks every path.
How to test each boundary before production
Each boundary can become an executable assertion before go-live. The tests below use synthetic data and test credentials, record attempts and observe the component making the decision. A successful result confirms only the paths and conditions exercised; it is not comprehensive proof of the deployment or of every possible access path.
Tests should start with a known baseline: record the identity, task and policy used for each attempt without including the raw token value in logs. Then compare permitted and forbidden actions through the same authorized path. A missing model call is not an authorization denial. For execution, inspect files, variables and host access as well as denied destinations and metadata. Check direct access, redirects, DNS and IPv6 as appropriate for the environment; an accepted connection on an unexamined route leaves coverage incomplete. For a bound credential, validation must occur at the resource, not just on the connection. For actions requiring approval, check that the payload matches when the effect occurs. In routing, inspect the primary path, fallback and configured cap. In the test environment, inspect log fields, correlation, protection and access; requirements without evidence leave the boundary pending. Repeat tests after policy changes and record the component responsible for each decision.
- Injection in data. Insert a hostile instruction in a test document or log. Record any attempted action and decision; no call is not evidence that the control denied it.
- Sandbox. Test reads of a harness file and variable, host and metadata access, and connection to a forbidden destination. Record each denial and responsible control; confirm an allowed connection and no retained state between executions.
- Credential, scope and replay. With a synthetic token, test allowed access, scope, audience, expiration and the revocation window. Check issuance and validation of the certificate binding, including absent or mismatched certificates, and correct, absent and wrong-key DPoP proofs.
- Tool and direct access. Through the gateway, test forbidden and permitted actions with valid arguments. If the service is reserved for the gateway, block both directly; if direct access is authorized, test both there. Test both actions at the service through the appropriate authorized path and retain evidence of the service's own decision, without opening direct access reserved for the gateway. A network denial does not prove authorization at the service. Verify payload-bound approval when required.
- Fallback and cap. Simulate an unavailable primary route, verify approved fallback and denial at the cap. Check one allowed model and one outside the approved list.
Agent evaluation beyond the final answer adds observation of the path the agent took.
Frequently asked questions about AI agent security
Agent security depends on where the application decides access, not on a promise that the model will always interpret received content correctly. Tests must distinguish tool selection from authorization at the service and verify that policy remains effective when the agent encounters untrusted data in its operating environment.
Credential replay protection requires more than a short lifetime: anyone holding a valid bearer token can use it. RFC 8705 distinguishes mTLS client authentication from a certificate-bound access token. To restrict token use, the issuer must create the binding and the resource must validate it against the certificate presented on the connection. mTLS without binding does not, by itself, prevent replay of a stolen token: another client accepted by the resource can present it again if policy does not require a match. DPoP, defined in RFC 9449, also binds a token to a key through proof verified by the resource. When issuance and validation work, these mechanisms restrict use by anyone without the bound key. They do not prevent every repeated request by the authorized client. A short lifetime limits exposure but does not replace proof of possession or other replay controls.
How does AI agent security differ from traditional application security?
Both can have dynamic workflows. In agentic systems, untrusted content can influence the calls and arguments proposed by a model, whose selection may be defined outside the agent. Risk arises when those proposals receive authority without validation. External controls can deny them before the service carries out the requested action.
Does a stricter system prompt solve prompt injection?
No. Injection can come from external content or be direct, including in the user's prompt. A system prompt alone is not enough. Scoped tools, short-lived credentials and approval for irreversible actions limit access and effects. Those external controls do not prevent all influence or misuse of an allowed call.
Where does the inference layer fit within the security boundary?
With remote inference, request context leaves the agent process for the selected service, which can be inside or outside the organization. Local inference does not require sending data to an external provider. The operation should verify destination, approved-model policy, budget and decision records in the deployment it actually uses.
How can a team measure whether a credential boundary works?
Use synthetic credentials to test allowed access and denials for scope, audience and expiration. For a bound token, confirm issuance and resource-side validation, accepting the correct key or certificate and denying others. Measure the revocation window and check that logs do not expose tokens. mTLS alone does not prove binding.
References and further reading
The sources separate architecture, credential standards and log protection, so readers can check the mechanism behind each control without confusing a specification with verified behavior in a deployment. Documentation guides verification. Local tests remain necessary to demonstrate which permissions and denials work in the team's own environment.
Inference audits should record, as needed, model, provider, token count, cost, latency, a non-secret key identifier, time, policy, routing decision and result. They should also correlate the call with approval and effect when applicable, protect integrity and restrict access. The OWASP logging guidance addresses protection of data in logs: credentials and raw payloads should not be included by default. On the public Nexforce Router page, the vendor says it provides an API with more than 500 models, routing rules, budgets per key or agent and consolidated usage data. The model count has not been independently audited. The page does not establish a restrictive allowlist per key, fail-closed behavior at the cap or every trace field listed above. The operation should verify those requirements, not assume the product meets them. NIST SP 800-207 presents zero trust architecture as a reference for access decisions.
- Vercel. Security boundaries in agentic architectures. Technical blog, 2026. Analysis of boundaries between components.
- NIST. SP 800-207: Zero Trust Architecture. https://csrc.nist.gov/pubs/sp/800/207/final
- IETF. RFC 8693: OAuth 2.0 Token Exchange. https://www.rfc-editor.org/rfc/rfc8693
- IETF. RFC 9449: OAuth 2.0 Demonstrating Proof of Possession. https://www.rfc-editor.org/rfc/rfc9449
- IETF. RFC 8705: OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens. https://www.rfc-editor.org/rfc/rfc8705
- OWASP. Logging Cheat Sheet. https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html
- OWASP. Top 10 for LLM Applications. https://genai.owasp.org/llm-top-10/
- Nexforce. Nexforce Router: one API for leading AI models. https://nexforce.ai/router
The boundary nobody designed is the one that gives way
Each boundary needs an owner, tests in the pipeline and records of permitted and denied access, so the team can verify that policy remains in force after a change. A gateway is one possible control and logging point; the application and its telemetry can also contribute to the audit trail.
At the credential boundary, an identifier passed as an argument must go through policy: for a task tied to a client, the service should obtain client identity from trusted context and verify authorization at the resource, rather than relying only on the value supplied by the model. With synthetic test credentials, test an allowed call, denials for incorrect scope or audience, and expiration. For a bound token, confirm issuance and validation of the binding: accept the correct certificate and deny an absent or mismatched one, even when another certificate is accepted on the connection. For DPoP, test the correct proof, an absent proof and one using another key. A denial for a missing certificate may demonstrate only mTLS. Measure the interval between revocation and the last accepted call: that is the observed window, not the total damage. To identify who requested and performed the action, correlate human, agent, task and outcome identifiers without logging the raw token.

Save up to 50% in creditswith a single smart API
Connect your operations to our AI Router and optimize the consumption of multiple LLMs
Free TrialRelated articles

AI router in production: multi-model routing and fallback
An enterprise AI router governs inference traffic across multiple LLM providers, implementing dynamic routing, automatic failover, and budget caps.
Read more
Zero data retention: how to verify providers by endpoint
Zero data retention is an endpoint-level claim, not a vendor badge. Learn what to request, how to test with canaries, and how to audit gateway routes.
Read more
AI model benchmark: 8 index points, 26x the cost per task
The Nov 23 read of the Artificial Analysis leaderboard shows the last eight index points cost 26.3 times the price per task, and the break-even point depends on the cost of a failed task.
Read more