AI governance and assurance · AI agents · safety controls

AI agent safety architecture: tool permissions, sandboxing, approval gates, spend limits and a kill switch

How to let an AI agent act without letting it do harm: a permission broker issues narrow, short-lived tool access, risky code runs in a sandbox, high-impact actions wait for human approval, budgets cap spend and a kill switch stops everything.

A reference architecture from EITSAA, not a named client system. Service limits, prices and product features change, so confirm current details before you commit to a design.

  • OWASP Top 10 for LLM Applications (excessive agency)
  • NIST AI RMF
  • Guidance for AI Adoption (human control)
  • ISO/IEC 42001
  • ACSC Essential Eight
  • APRA CPS 230

Architecture

Architecture diagram. Tinted boundaries show regions, accounts, networks and trust zones. Numbered arrows match the flow below.
AI agent safety architecture: tool permissions, sandboxing, approval gates, spend limits and a kill switch architectureUsers and triggers to Agent orchestrator: task. Agent orchestrator to Permission broker: request scope. Agent orchestrator to Tool gateway: tool call. Tool gateway to Sandbox: execute. Tool gateway to Budget and limits: check limits. Sandbox to Human approval: propose. Tool gateway to Business systems: approved call. Human approval to Trace and audit: decision. Kill switch to Agent orchestrator: haltRequestersAgent runtime · private networkSafety controlsBusiness systemsUsers and triggersTickets, schedules, requestsAgent orchestratorPlans steps, calls toolsPermission brokerScoped, short-lived tokensTool gatewayAllow-list, schema validationSandboxCode and browsing, no secretsHuman approvalHigh-impact actionsBudget and limitsSteps, tokens, spendKill switchPer agent, tool and tenantBusiness systemsCRM, ITSM, financeTrace and auditEvery step and decision1task2request scope3tool call4execute5check limits6propose7approved call8decision9haltPlatform servicesIdentityprovider (SSO)Monitoring andalertsAudit logKey management(KMS)
  • People and clients
  • AI and ML
  • Security and identity
  • Monitoring, audit and analytics
  • SaaS and business systems
  • Request or data flow
  • Asynchronous or optional
  • Boundary: region, account, network or trust zone

Request and data flow

  1. A user, schedule or event gives the agent a task. The request carries identity so actions are attributed and limited to what that user may do.

  2. Before using a tool, the agent requests a scope from the permission broker, which issues a narrow, short-lived credential bound to the task and user.

  3. Every tool call goes through the tool gateway, which allows only registered tools, validates arguments against schemas and refuses anything else.

  4. Code execution and browsing run in a sandbox with no standing secrets, restricted network egress and resource limits.

  5. The gateway checks the budget: step count, tokens, tool calls and spend per task, user and day. Exceeding a limit stops the run.

  6. Actions classed as high impact, such as payments, deletions or external messages, are proposed rather than executed, and wait for a human decision.

  7. Approved calls reach business systems using the scoped credential, with read-only access by default and reversible changes where possible.

  8. Approvals, rejections, reasons and the full action trail are written to the audit record, so each outcome can be reconstructed.

  9. A kill switch can halt a single agent, a tool or a whole tenant within minutes, and is tested regularly.

Components and why they were chosen

ComponentWhat it doesWhy this choice
Agent orchestrator (LangGraph, Bedrock Agents, Azure AI Foundry Agent Service, Semantic Kernel)Plans and sequences steps.Keeps reasoning separate from permissions.
Permission broker (cloud IAM, token exchange, secrets manager)Issues scoped, short-lived credentials.No standing privileges for agents.
Tool gateway (MCP gateway or API gateway)Allow-list, schema validation and rate limits.A single enforcement point for tools.
Sandbox (microVM, container with egress control)Isolated execution.Contains injected or buggy code.
Approval serviceHuman review with context.Meaningful human control for consequential actions.
Trace store (OpenTelemetry, Langfuse)Full step traces.Investigation and evidence.

Design decisions and trade-offs

Autonomy level

Read-only by default, write with approval for high impact, autonomous only for low-risk reversible actions.

Why. Matches authority to consequence.

Trade-off. More approvals reduce speed.

Identity of the agent

Act on behalf of the user with a scoped token, never with a shared admin account.

Why. Preserves entitlements and attribution.

Trade-off. Token exchange adds complexity.

Where to validate

At the tool gateway, outside the model.

Why. The model cannot talk its way past code.

Trade-off. Schemas need upkeep.

Multi-agent design

Separate agents with separate scopes and a supervisor that cannot exceed the user's scope.

Why. Limits cascading errors.

Trade-off. More moving parts to trace.

Stop mechanism

Central kill switch plus per-run budgets.

Why. Contains loops and incidents fast.

Trade-off. Must be tested or it will not work when needed.

Well-architected pillars

Security

Least privilege, scoped short-lived credentials, sandboxing, egress control and untrusted-content handling for all tool outputs.

Reliability

Idempotent tool calls, retry with limits, checkpointed state and a manual fallback process.

Performance

Parallelise safe read calls and keep approval requests concise.

Cost optimisation

Budgets per task and day contain runaway loops and unbounded consumption.

Operational excellence

Runbooks for agent incidents, regular kill-switch drills and review of approval queues.

Sustainability

Cap step counts and prefer smaller models for routine steps.

Network, identity and data

Networking

The runtime and sandbox have no default internet access. Egress is allow-listed through a proxy. Tools are reached over private connectivity and the gateway is the only path from the agent to business systems.

Identity and least privilege

Each agent has its own identity. User-delegated actions use token exchange with narrow scopes. Approvers are separate from requesters. Administrative access to the broker and gateway is tightly restricted.

Data and encryption

Give agents the minimum data for the task. Mask sensitive fields in traces. Keep memory stores scoped and expire them. Classify tool outputs as untrusted content.

Security and compliance mapping

ControlHow this design addresses it
Excessive agencyTool allow-lists, scoped credentials and approval gates address OWASP LLM06.
Human controlApproval gates and a kill switch support the Guidance for AI Adoption practice on human control.
Restrict administrative privilegesAgents never hold admin credentials. Essential Eight.
Application controlOnly registered tools and signed agent versions can run. Essential Eight.
Operational resilienceFallback procedures and tested stop mechanisms support CPS 230 expectations.

Mappings show how the design supports each control. They are not certifications, and EITSAA does not claim IRAP assessment or compliance for any reference architecture.

Failure modes, targets and scaling

  • Target RTOUnder one hour for the gateway and broker. Agents can be switched to manual process while recovering.
  • Target RPONear zero for audit and approvals. Task state is checkpointed.
  • Scaling and limitsSized by concurrent runs and tool call rates.
Failure modeMitigation
Injected instructions in a document cause a harmful tool callTreat content as data, validate calls at the gateway and require approval for high impact.
Agent loops and burns budgetStep, token and spend limits with alerts and automatic halt.
Approver clicks through without readingShow concise context, sample decisions for audit and limit approval volume.
Tool schema change breaks behaviourContract tests for tools and staged rollout.
Credentials leak through tracesMask secrets, never pass credentials through the model and scan stores.

Observability and runbooks

  • Steps, tool calls and spend per run.
  • Approvals requested, granted and rejected.
  • Blocked calls and schema violations.
  • Kill-switch tests and time to halt.

Cost drivers and levers

Model tokens per step, sandbox compute, approvals handling time and trace storage.

  • Hard budgets per run.
  • Smaller models for routine steps.
  • Cache read-only tool results.
  • Sample traces for low-tier agents.

Implementation and fit

Phased approach

  1. Start with read-only tools and full tracing.
  2. Add the tool gateway, scoped credentials and budgets.
  3. Add sandboxing and approval gates for write actions.
  4. Add kill-switch drills, multi-agent supervision and regression tests for attacks.

Anti-patterns to avoid

  • Giving an agent a shared admin credential.
  • Validating tool calls only in the prompt.
  • Approval with no context.
  • No spend cap.
  • An untested kill switch.

When to use it

  • Agents that act on tickets, records, payments or messages.
  • Multi-agent workflows that cross systems.

When not to

  • A chatbot that only answers questions from approved documents.
  • Processes that need deterministic, auditable logic only.

More in ai governance and assurance

Related insights

Discuss this architecture

Tell us your systems, constraints and timeline. We reply within one business day, and the initial conversation is free.