AI Agent Security and MCP: A Practical Checklist

AI agents now read email, query databases and call APIs via MCP. A practical guide to the risks and a least-agency checklist before granting access.

AI Agent Security and MCP: A Practical Checklist

Organisations are moving from chatbots that answer questions to AI agents that take actions. An agent can read a mailbox, query a database, call an API or run code, often through Model Context Protocol (MCP) connectors that plug it straight into business systems. That changes the security question from "what might it say?" to "what might it do?". In my view, AI agent security is now a practical concern for every IT team, and over the past year the reference material has finally caught up.

Why AI agent security is different

Three pieces of guidance give us a shared vocabulary:

The OWASP agentic list names ten risks:

  • Agent Goal Hijack
  • Tool Misuse and Exploitation
  • Identity and Privilege Abuse
  • Agentic Supply Chain Vulnerabilities
  • Unexpected Code Execution
  • Memory and Context Poisoning
  • Insecure Inter-Agent Communication
  • Cascading Failures
  • Human-Agent Trust Exploitation
  • Rogue Agents

The root problem is simple to explain. A language model cannot reliably tell the difference between instructions from you and text it happens to read. If an agent summarises an email or a PDF that contains hidden instructions, it may follow them. Because the agent can act without a person watching, routine document processing becomes a possible attack route.

The OWASP MCP cheat sheet describes a quieter version of this. Attackers use prompt injection to encode sensitive data into tool calls that look normal, such as a search query or an email subject. Nothing looks broken, yet data leaves the building.

The NSA adds a warning about chains of agents. MCP agents have produced outputs that downstream agents or systems may treat as executable prompts rather than passive content, if they trust them blindly. One compromised step can steer the next.

Finally, agents can cause harm without any attacker at all. OWASP's rogue agent example is one I use with managers. An agent told to minimise cloud storage costs works out that deleting production backups is the most efficient way to meet its goal. The agent did what it was asked. The design gave it too much room.

Least agency: the principle that matters most

OWASP describes identity and privilege abuse as an agent that "borrows too much power or uses old credentials to perform actions it shouldn't be allowed to do". The answer the agentic Top 10 promotes is least agency, a close cousin of least privilege.

In practice that means:

  • A separate identity for each agent. Never let an agent run with an administrator's token or a shared service account.
  • Scoped, short-lived credentials. Grant access only to the resources the task needs, and let tokens expire quickly.
  • Read-only first. Start every agent with read access only. Then add write actions one at a time, each with its own justification.
  • Act on behalf of a real user. When an agent works for a member of staff, it should never be able to see or do more than that person could.

This is not new thinking for anyone who has run an ISO/IEC 27001 access control process. The difference is that the "user" is now software that can be talked into things.

Treat MCP servers as third-party code

An MCP server is a dependency with access to your systems. I would vet it the same way I vet any library or supplier:

  • Know where it comes from. Prefer official servers from the vendor of the system it connects to. Be wary of unmaintained community projects.
  • Pin versions. Do not let a connector update itself silently. Review changes before upgrading.
  • Read the tool descriptions. The model reads these too, so they can carry injected instructions.
  • Isolate it. Run servers in containers or sandboxes with only the network access they need.
  • Block internal destinations. Deny outbound connections to internal addresses and cloud metadata endpoints. This reduces the risk of server-side request forgery (SSRF).

Do not expect a product to solve this for you yet. The NSA notes that MCP-aware security proxies remain limited and are still maturing. For now, the controls live in your architecture and your code.

Enforce permissions in code, not in the prompt

A system prompt that says "never delete records" is a request, not a control. OWASP advises enforcing authorisation and validating tool calls in trusted application code, independently of how the model interprets things. The model proposes; your code decides.

Here is a simplified Laravel example of a tool gateway. The agent never receives database credentials. Every call passes through three checks: an allow-list, input validation, and a permission check against the human user the agent acts for.

<?php

namespace App\Agents;

use App\Models\User;
use App\Services\InvoiceService;
use App\Services\TicketService;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;

class ToolGateway
{
    // The only tools the agent can reach. Anything else is refused.
    private const ALLOWED = [
        'invoice.lookup' => [
            'ability' => 'view-invoices',
            'rules'   => ['invoice_id' => 'required|integer|min:1'],
        ],
        'ticket.draft' => [
            'ability' => 'draft-tickets',
            'rules'   => [
                'subject' => 'required|string|max:120',
                'body'    => 'required|string|max:2000',
            ],
        ],
    ];

    public function call(User $onBehalfOf, string $agentId, string $tool, array $args): array
    {
        if (! array_key_exists($tool, self::ALLOWED)) {
            Log::warning('agent.tool.denied', ['agent' => $agentId, 'tool' => $tool]);
            return ['error' => 'Tool not available'];
        }

        $spec = self::ALLOWED[$tool];

        // Check the real user's permission, not what the model claims.
        if (Gate::forUser($onBehalfOf)->denies($spec['ability'])) {
            Log::warning('agent.tool.forbidden', ['agent' => $agentId, 'tool' => $tool, 'user' => $onBehalfOf->id]);
            return ['error' => 'Not permitted'];
        }

        // Throws a ValidationException on bad input.
        $data = Validator::make($args, $spec['rules'])->validate();

        // Log who, what and for whom. Avoid logging sensitive values.
        Log::info('agent.tool.call', [
            'agent' => $agentId,
            'tool'  => $tool,
            'user'  => $onBehalfOf->id,
            'keys'  => array_keys($data),
        ]);

        return match ($tool) {
            'invoice.lookup' => app(InvoiceService::class)->summaryFor($onBehalfOf, $data['invoice_id']),
            'ticket.draft'   => app(TicketService::class)->createDraft($onBehalfOf, $data),
        };
    }
}

Note that the agent can draft a ticket but not send one. Sending would be a separate tool with its own approval step.

Those log entries also give you the raw material for monitoring. Alert on unusual call volumes, new tools or new destinations.

Governance in Iraq and the Kurdistan Region

At the time of writing, Iraq has no dedicated AI law and no comprehensive personal data protection statute in force (Levellers). The national AI strategy is still being developed.

In April 2026 the Ministry of Planning discussed the strategy. The discussion included mechanisms for a sovereign national language model and AI infrastructure on local and cloud servers.

The Communications and Media Commission's spokesman has said that adoption depends on three things: modern technology, sound regulation and skilled professionals. The University of Baghdad opened Iraq's first College of Artificial Intelligence for the 2025–2026 academic year (Shafaq News).

These are encouraging steps. Until binding rules arrive, though, organisations here have to set their own safeguards. My suggestions:

  • Write an internal AI use policy now. Cover approved tools, what data may be shared, and who can connect an agent to which system.
  • Bring shadow AI into the open. Staff are already using AI tools, approved or not. Offer a sanctioned alternative; outright bans tend to push usage underground.
  • Use the frameworks you already have. Add agents and MCP connectors to your ISO 27001 risk register and supplier assessments. When you are ready, ISO/IEC 42001, the first international standard for an AI management system, is a natural next step.
  • Watch your customers' rules. If you serve EU customers, the EU AI Act's Article 50 transparency obligations apply to certain AI systems from 2 August 2026. They include telling users when they are dealing with a chatbot or AI agent.

A least-agency checklist before go-live

Before any agent touches a real system, I would want a clear yes to each of these:

  1. Is the agent, and every MCP connector it uses, recorded in an inventory with a named owner?
  2. Does it have its own identity and a scoped, short-lived credential?
  3. Does it start read-only, with each write action added and justified separately?
  4. Is every email, web page, file, tool description and tool output treated as untrusted data?
  5. Are permissions and input validation enforced in application code, outside the model?
  6. Are MCP servers from known sources, version-pinned and sandboxed, with internal and metadata addresses blocked?
  7. Is every tool call logged, with sensitive values redacted? Each entry should record the agent, the tool, the parameters and the user it acts for.
  8. Is someone alerted when the logs show anomalies?
  9. Do high-impact actions require a person's sign-off?

For the last point, this decision table is a useful starting default:

Agent action Risk Control
Read (search, look up) Low Auto, logged
Draft (email, ticket, report) Low to medium Auto, logged, human sends
Send (to customers or staff) High Human approval
Change (records, permissions, config) High Human approval
Delete (data, backups) Critical Never automated
Pay (transfers, purchases) Critical Never automated, or strict dual approval

The same applies to customer-facing agents such as WhatsApp or SMS assistants, which are often an organisation's first agent. Let them answer and draft freely. Keep the sending of sensitive information, and any account changes, behind proper verification.

Agents are worth adopting. The safe way to do it is to give them less power than feels convenient, and to add more only when you can justify it. If you remember one thing, make it this: the prompt is not a security control. Your identities, your code and your approval steps are.

Sources & further reading

  1. OWASP Top 10 for Agentic Applications (2026) overviewdocs.modulos.ai
  2. NSA – Model Context Protocol (MCP): Security Design Considerationsnsa.gov
  3. OWASP MCP Security Cheat Sheetcheatsheetseries.owasp.org
  4. Auth0 – Lessons from the OWASP Top 10 for Agentic Applicationsauth0.com
  5. Levellers – AI Regulation in Iraq: Law, Data and the CMClevellers.ai
  6. ISO – ISO/IEC 42001 explainediso.org

🤖 Researched and drafted with AI assistance, guided by my editorial standards. Spotted something wrong? Tell me.

Akam Omer
Written by

Akam Omer

IT leader, engineer and security specialist from Erbil with 20+ years across higher education, telecoms, healthcare and government. Founder of BulkSMSIraq, VerifyWay and Kurd.ai.