Research
MCP security checklist: how to govern tool access before your AI agents do something expensive
A security framework for governing Model Context Protocol access to prevent costly AI agent mistakes
· Cantina
Five AI agent security engineering rules for permissions, prompt injection, execution controls, monitoring, and incident response.
AI agent security engineering is the practice of constraining what an agent can read, decide, and execute, then verifying every high-impact action. A secure design combines untrusted-model assumptions, least-privilege tools, deterministic approval gates, continuous logs, and recovery paths. These controls reduce the damage an injected prompt or faulty plan can cause.
AI agents are becoming part of modern software development pipelines. They analyze codebases, fetch documentation, write code, trigger API calls, and manage infrastructure, often with minimal human intervention. Entire engineering workflows can now run on partial automation.
For many developers, the driving question is: how much more can we ship with agentic tools?
Teams building resilient systems need to ask something else entirely.
What breaks when the agent gets it wrong? What happens if someone is actively exploiting it?
Security-conscious AI agent developers don’t begin by optimizing for capability. They begin by defining hard limits: what the agent must never be permitted to do.
Because once an agent gains access to external data, tooling, and the ability to execute actions, it ceases to function as a simple productivity aid. It becomes a security-critical automation layer embedded in your infrastructure.
Recognizing that transition is what distinguishes hobby-level prototypes from production-ready systems.
The foundational principle: never trust model output by default.
Language models don’t maintain a strict separation between instruction and content. When an agent ingests external material (documentation, web pages, code comments, user messages), that material can contain text designed to influence how the model reasons.
This is the mechanism behind prompt injection attacks.
OWASP classifies prompt injection as LLM01:2025. The risk includes both direct instructions from a user and indirect instructions hidden in content an agent reads, such as a webpage, document, code comment, or tool response.
What makes it uniquely dangerous is that it’s architectural, not incidental. A model interprets language rather than executing deterministic instructions, which means the attack surface is the model itself.
Experienced engineers therefore operate under the assumption that any model-generated output may have been shaped by adversarial content somewhere in the pipeline.
Safe systems must hold even when the model has been partially misled.
This is not theoretical. Our analysis of prompt injection paths from untrusted content to host code execution shows why downstream controls must assume that model reasoning can be influenced.
The impact of an agentic failure often depends less on model intelligence than on the permissions available to the agent.
Agents are routinely given access to push code, run shell commands, call third-party services, and modify cloud infrastructure. When those permissions are wider than necessary, any reasoning error, whether accidental or induced, can have severe downstream consequences.
In security engineering, this is known as the excessive agency problem. OWASP’s guidance on excessive agency recommends minimizing the functions, permissions, and autonomy available to an LLM-based system. An agent tasked with reading API documentation shouldn’t hold write permissions on your production database. An agent that drafts pull requests shouldn’t be able to merge or deploy them.
Restricting scope directly limits the blast radius of any compromised behavior.
A defensible design pattern for agentic architectures is the separation of planning and execution.
Rather than allowing a model response to directly trigger system actions, the agent first generates a plan. That plan is then reviewed by deterministic verification layers before anything is executed.
This creates a controlled checkpoint between model reasoning and real-world impact.
A practical implementation might look like this:
This architecture ensures that no single model output can unilaterally trigger high-stakes operations.
The boundary needs to be explicit in the product and its operating policy. Our guide to coding-agent auto-approve controls explains where automatic execution becomes unsafe and where a hard approval gate belongs.
Agentic tooling can meaningfully accelerate development velocity. But speed is not a substitute for verification.
Security-conscious AI agent engineers treat security gates as first-class pipeline requirements, not optional add-ons applied after the fact.
Code produced by an AI agent should pass through the same review infrastructure as human-authored code:
These controls reduce the chance that AI-generated code circumvents the safeguards protecting your production systems.
The NIST AI Risk Management Framework treats risk management as a continuous activity across the AI system lifecycle. Agentic pipelines are no exception: testing, evaluation, validation, and verification need to continue after deployment rather than end at launch.
For a measured example of how automated security performs against human work, see our AI versus human security audit benchmark.
Autonomous systems demand comprehensive visibility.
Agents can execute many actions across multiple services in seconds. Without structured logging and runtime monitoring, unexpected or harmful behavior can go undetected until significant damage is done.
Experienced engineers instrument their agentic workflows with the same rigor they apply to production infrastructure.
Key observability targets include: tool invocations, shell command execution, repository modifications, external network calls, and system-level changes.
Robust observability supports earlier anomaly detection and faster incident response when something goes wrong.
These principles exist because agentic architectures introduce attack surfaces that traditional security tooling wasn’t designed to address.
Prompt injection allows adversarial content embedded in external data to influence model reasoning. Tool misuse can cause an agent to trigger unintended operations at scale. Memory layer manipulation can corrupt the context agents rely on for future decisions. Unsafe model output can introduce vulnerabilities if downstream systems treat it as trusted input.
Conventional application security often starts with code and runtime behavior. Agentic systems add dynamic reasoning, contextual inputs, delegated identity, and autonomous execution to that threat model.
Before an agent receives production access, we should be able to answer yes to each of these questions:
For agents connected through Model Context Protocol, use the MCP security checklist to map tool access, approval boundaries, identity, and audit evidence before deployment.
Agentic development is changing how software is designed and built. Engineers increasingly work alongside autonomous systems that interpret context, generate solutions, and take independent action.
That shift creates significant productivity leverage, but it also creates new security responsibilities.
The engineers building the most dependable systems operate from a set of core assumptions:
Organizations that internalize this mindset can pursue development speed without treating reliability as an afterthought.
To see how Cantina connects security agents, approvals, shared context, and an auditable record of action, explore the Clarion platform.