Securing AI Agents : Permissions, Secrets, and Supervision

Securing AI Agents : Permissions, Secrets, and Supervision
7 min read

Securing an AI agent is less about controlling what it decides than limiting what it can do: a distinct identity, permissions reduced to its mission, secrets that never pass through the model, human validation before any irreversible action, complete logs, and a tested emergency stop. This approach is essential because prompt injection, the main threat against agents, has no known foolproof defense according to OWASP. The scope of action therefore remains the strongest protection.

This article is for teams preparing to connect an agent to real software: messaging, CRM, database, payment tools. The cited sources were consulted in November 2026. For basic concepts on how agents work and their levels of autonomy, see our reference guide on AI agents and automation.

Threats specific to agents connected to tools

A chatbot that makes a mistake produces bad text; an agent that makes a mistake can send an email, modify a database, or trigger a payment. The difference lies in the tools. OWASP, in its 2025 ranking of LLM application risks, places prompt injection at the top and includes an entry on excessive agency, which directly concerns agents. The organization has supplemented this work with a Top 10 dedicated to agentic applications, published on December 9, 2025.

Indirect injection is the most specific threat. According to the OWASP sheet, it occurs when the model reads external content, a web page or file, containing instructions that alter its behavior. An agent summarizing emails can thus come across a booby-trapped message asking it to forward attachments to an external address. The risk becomes maximal when a single agent combines three capabilities: reading confidential data, processing untrusted content, and communicating externally.

Threat Example Main defense
Indirect prompt injection Hidden instruction in a document read by the agent Separate external content, validate sensitive actions
Excessive agency Reading agent also having deletion rights Minimal rights, granular tools
Sensitive information leak API key or customer data copied into a response Secrets out of context, output filtering
Malicious third-party component Unverified tool server installed by a user Approved tool list, isolated execution
Unbounded consumption Loop on an API in error Per-task ceilings, automatic cutoff

Connection protocols add their own risks. The Model Context Protocol specification reminds us that tools represent arbitrary code execution and that their descriptions should be considered untrusted, unless they come from a trusted server.

Identity and permission management by mission

Each agent must have its own identity, distinct from that of an employee, and be linked to a named manager. This is the condition for knowing, after the fact, which agent did what and on whose behalf. The starting observation is not reassuring: according to the Okta Global CISO Insights 2026 study, cited in our article on AI agent governance facing the AI Act, 81% of security leaders surveyed are concerned about excessive access granted to AI, but only 47% say they can identify all agents present in their environment. Inventory, accountability, and lifecycle issues fall under AI agent governance, which complements the technical measures described here.

Permissions are defined by mission, not by agent: a support agent does not need the same rights to answer a question and to process a refund. The OWASP sheet on excessive agency draws several rules from this: expose only strictly necessary tools, prefer precise tools to open tools like command execution, grant minimal rights on target systems, act within the context of the user for whom the agent is working, and enforce permissions in those systems rather than letting the model judge if an action is permitted.

A breakdown applied to a support agent

  • reading customer records and order history: allowed, limited to useful fields;
  • creating and updating tickets: allowed, logged;
  • refund”: “dedicated tool”, capped by the payment system, with human approval beyond a company-set amount;
  • data export, deletion, sending to an external address: no tool available.

On the protocol side, the MCP specification recommends a progressive scopes model: an initial set limited to low-risk read operations, then a targeted elevation when the agent attempts a privileged operation. It lists among common errors generic scopes like total access and grouping unrelated privileges to avoid future requests.

Protecting secrets and limiting actions

A secret that passes through the model’s context can reappear in a response or in a log. API keys, passwords, and tokens must therefore remain in a secrets vault and only be injected at the moment of the call, by the tool execution layer, without ever appearing in the prompt. Prefer short-lived tokens, specific to each agent, individually revocable.

The MCP security best practices, in their version of July 28, 2026, for example prohibit a server from accepting a token that was not issued for it, to prevent a hijacked token from serving as a master key to other services. They also recommend executing local servers in an isolated environment, with minimal rights, and blocking requests to internal IP ranges. Our article on the MCP protocol and its uses explains the role of these tool servers in an agent’s architecture.

The criteria that make the difference

Criterion Minimum level Enhanced level
Secrets Outside the prompt and code, in a vault Ephemeral tokens per agent and per mission
Tools Closed list of approved tools Parameters validated by schema, capped values
Code execution Isolated environment Isolated, no network access except authorized list
Network outputs Internal destinations blocked Outbound proxy with allowed domain list
Action volume Rate limit per agent Budget per task with automatic cutoff

Logs, approvals, and emergency stop

Each tool call must leave a trace: agent identity, mission, tool, parameters, response, timestamp, and correlation identifier with the original request. These logs must be protected against modification and purged of secrets. OWASP reminds us: logging, monitoring, and rate limiting do not prevent an incident, but they limit its damage and allow us to understand it.

High-impact actions require human approval. MCP security principles also stipulate that the host application obtain the user’s explicit consent before invoking a tool, and that the user understand what the tool does. The approval screen must show the exact action, with its full parameters, not a summary written by the agent. Finally, plan an emergency stop: immediate revocation of the agent’s tokens, deactivation of its tools, interruption of ongoing tasks.

Errors that cancel these protections

The first is approval fatigue: if an agent requests validation every two minutes, validators end up approving without reading. Therefore, reserve approval for truly sensitive actions. The second is the never-tested emergency stop, which fails the day it is needed. The third is writing prohibitions in the prompt rather than in permissions: an injected instruction can contradict the prompt, not a missing right.

Checklist before production

  1. The agent has its own identity and a named manager.
  2. Its tools are listed, approved, and limited to its mission.
  3. Its rights on each system are as restricted as possible, and enforced by those systems.
  4. No secret appears in the prompt, code, or logs.
  5. Tokens are specific to the agent, time-limited, and revocable.
  6. External content read by the agent is identified as untrusted.
  7. Irreversible, financial, or external actions go through human approval that displays the exact action.
  8. Code execution and local tool servers run in an isolated environment.
  9. Network outputs are limited to necessary destinations.
  10. Token, step, and spending ceilings automatically cut off the agent.
  11. Each tool call is logged with a correlation identifier.
  12. The emergency stop has been triggered at least once in testing.

Verifying the checklist holds

A checked box proves nothing until it has been tested. Explicitly ask the agent to execute a prohibited action and verify that the target system refuses it. Slip documents containing malicious instructions into its sources, inspired by documented prompt injection techniques, and check that no unrequested action is triggered. These tests integrate into the broader protocol described in ‘How to measure the reliability of an AI agent? Tests and indicators.’ Their limit is structural: they cover known attacks, hence the need to update them and monitor logs continuously.

S’abonner
Notification pour
guest

0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
0
Nous aimerions avoir votre avis, veuillez laisser un commentaire.x