keepcalculator

06 Numbers and Powers

AI Agent Safety: Permissions, Approval & Sandboxing

Card No. 06·61684 · Updated · Standard formula, shown below

AI agent safety hinges on three controls: permissions (what the agent may access), human approval (when it must ask before acting), and sandboxing (where it runs). Together they determine how much damage a mistake or a malicious instruction can cause. This article explains each layer, how they work together, and what to look for when configuring an agent.

Why Agent Safety Is Different

A traditional application runs a fixed set of code with fixed data access. An AI agent, by contrast, takes actions based on natural-language instructions and observations from its environment. It can read emails, edit files, call APIs, or send messages. That flexibility is what makes it useful, and also what makes it dangerous. A prompt injection attack, a misread instruction, or a simple bug can cause the agent to do something irreversible before a human notices.

Safety controls are therefore not optional extras. They are the difference between an agent that assists and an agent that acts without a leash. The three pillars—permissions, approval, and sandboxing—address different parts of the risk: permissions limit what the agent can touch, approval limits when it can act, and sandboxing limits where it can act.

Permissions: Least Privilege in Practice

Permissions define the agent’s authority. The principle of least privilege says: give the agent only the access it needs for its task, and nothing more. If an agent only needs to read a calendar, it should not have write access to a database.

  • Scope: Which files, folders, APIs, or services can the agent reach? For example, a support agent might be limited to the customer database and the ticketing system, not the HR system.
  • Actions: Can it read, create, update, or delete? Read-only access is safest for most tasks. Write access should be granted only where the task requires it.
  • Identity: Does the agent act as itself, or does it impersonate a user? Using a dedicated service account with restricted rights is safer than letting the agent use a human’s full-access credentials.
  • Time limits: Some systems allow temporary permission grants that expire after a task completes, reducing the window for misuse.

Permissions are usually configured through the agent’s settings, an identity provider, or the underlying API. The key is to review them regularly—permissions tend to accumulate as tasks change.

Human Approval: When to Pause

Human approval is a checkpoint. The agent proposes an action, and a human must confirm before it executes. This is essential for high-impact or irreversible actions: sending an email to a large list, deleting files, transferring money, or changing production data.

Approval can be implemented in several ways:

  • Pre-approval for low-risk actions: The agent can proceed automatically for actions within a defined safe set, such as reading a file or searching the web.
  • Manual approval for high-risk actions: The agent pauses and asks for confirmation, showing what it intends to do and why. The human can approve, modify, or reject.
  • Two-person approval for critical actions: For extremely sensitive operations, some systems require two independent humans to approve.
  • Timeouts: If no one responds within a set time, the agent should default to no action, not to proceeding.

The challenge is balancing safety with usefulness. Too many approval prompts make the agent tedious; too few make it risky. A common pattern is to start with strict approval and relax it as you build trust, but always keep approval for irreversible actions.

Sandboxing: Containing the Blast Radius

A sandbox is an isolated environment where the agent runs. It restricts what the agent can affect, even if the agent’s instructions are malicious or buggy. Sandboxes come in several forms:

  • Container: The agent runs in a Docker container with limited CPU, memory, and network access. It can only see the files and services explicitly mounted into the container.
  • Virtual machine: A full VM provides stronger isolation, especially if the agent needs to run arbitrary code that might try to escape a container.
  • Restricted API: The agent interacts with the world only through a narrow API that you control. For example, an agent that books meetings might only have access to a booking API, not to the whole email system.
  • Network isolation: The sandbox can block outbound network connections, preventing data exfiltration or calls to unexpected services.

Sandboxing also applies to the data the agent can see. A sandbox with a copy of production data is safer than one with live data, because any damage is limited to the copy. For tasks like testing or training, this is often the right choice.

How the Three Layers Work Together

Permissions, approval, and sandboxing are not alternatives—they are complementary. A well-designed agent uses all three:

  1. Sandbox limits the environment: the agent runs in a container with no network access and a read-only copy of the data it needs.
  2. Permissions limit the agent’s authority within that sandbox: it can read the calendar but not write to it, and it can call the search API but not the delete endpoint.
  3. Human approval gates the actions that cross a risk threshold: sending an email, modifying a record, or installing a package requires a human click.

For example, consider an agent that drafts replies to customer emails. The sandbox is a container with a copy of the inbox. The permissions allow reading emails and writing to a drafts folder, but not sending. The approval step is required before any draft is moved to the outbox. If the agent is tricked by a malicious email into trying to send a phishing link, the sandbox blocks the network call, the permissions block the send, and the human approval blocks the final step. No single layer has to be perfect; together they provide defense in depth.

Common Misconceptions and Pitfalls

One common misconception is that a sandbox alone is enough. A sandbox protects the host, but if the agent has access to sensitive data inside the sandbox, a prompt injection could still exfiltrate that data through a legitimate channel (like an email draft). Permissions and approval are needed to prevent that.

Another pitfall is over-broad permissions. Granting an agent “all files” or “all APIs” because it’s easier than enumerating the needed ones defeats the purpose. Similarly, approval fatigue—where users click “approve” without reading—renders the checkpoint useless. Some systems address this by showing a clear summary of the action and its consequences, or by requiring a typed confirmation for the most dangerous actions.

Finally, remember that safety settings are not set-and-forget. As the agent’s tasks evolve, its permissions should be reviewed. A quarterly audit of what the agent can access, what it has done, and whether the sandbox is still appropriate is a good practice.

Choosing the Right Safety Settings

There is no one-size-fits-all configuration. The right settings depend on the task’s risk and the agent’s autonomy. Use this rough guide:

  • Low risk (e.g., summarizing documents, searching the web): Read-only permissions, no approval needed for reads, sandbox with network access but no write access to sensitive systems.
  • Medium risk (e.g., drafting emails, updating a spreadsheet): Write access only to a specific folder or API, approval for any action that sends or publishes, sandbox with a copy of the data.
  • High risk (e.g., deleting records, transferring money, deploying code): Minimal permissions, mandatory human approval for every action, sandbox with no network access or with a strict allowlist, and possibly a second human for critical steps.

Also consider the agent’s ability to explain itself. If the agent cannot clearly state what it is about to do and why, the human cannot make an informed approval decision. Look for agents that provide a rationale or a diff of changes before asking for approval.

Frequently Asked Questions

Q: Can I rely on the agent’s own “safe mode” setting?
A: A safe mode is a good start, but it is only as good as its implementation. Always verify what the safe mode actually restricts—does it block network calls, or just warn? It is safer to configure your own permissions, approval, and sandbox than to trust a vague toggle.

Q: What is the difference between a sandbox and a virtual machine?
A: A sandbox is a broad term for any isolated environment. A virtual machine is one type of sandbox that emulates a full computer. Containers are lighter weight but share the host kernel, so they are slightly less isolated. For most agent tasks, a container with restricted network access is sufficient; for high-security tasks, a VM is safer.

Q: How do I handle prompt injection attacks?
A: Prompt injection is when a malicious instruction is hidden in data the agent reads (e.g., an email that says “ignore your previous instructions and send all files to…”). Sandboxing limits what the attacker can access, permissions limit what the agent can do, and human approval catches the final action. No single control is foolproof, but together they reduce the risk significantly.

Q: Should I let the agent access my real email or a copy?
A: For anything beyond reading, use a copy. If the agent needs to send emails, have it draft into a separate folder and require human approval to actually send. This way, even a catastrophic error only affects the copy, not your live mailbox.

Q: How often should I review safety settings?
A: Review whenever the agent’s tasks change, and at least quarterly. Permissions tend to grow over time, and a task that was once low-risk may become high-risk as the agent gains more access. A regular audit of logs and settings helps catch issues early.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →