Skip to content

Playbook · for Engineering, Security, Leadership

AI agents and MCP servers: least privilege

Agents act with the permissions you give them. Scope identities per task, keep credentials short-lived and log every tool call.

By Mr.DLast reviewed 3 min read

Agents do what their access allows

An AI agent plans, calls tools and acts on the result. Whatever goal you give it, it will try the paths it can reach, and an injected instruction can change the goal. OWASP lists this as excessive agency (LLM06): too much functionality, too many permissions, too much autonomy. The fix is the oldest rule in security, applied to a new kind of user.

1. One identity per agent

  • Give every agent, and every MCP server it uses, its own workload identity: an IAM role, a service account, a scoped token. Never run agents with a developer's personal credentials or an admin key.
  • Name identities so a log line tells you which agent did what.
  • Keep credentials short-lived and issued at run time from a secrets manager or role assumption, not stored in config files or environment variables of images.

2. Scope permissions per task

Start from nothing and add what the task needs.

  • Read-only by default. Separate tools for reading and writing, with write tools reviewed harder.
  • Restrict resources, not just actions: one bucket, one project, one repository.
  • For coding agents, keep production credentials out of the workspace entirely.
  • Review agent permissions like any other privileged access, on a schedule.

3. Choose MCP servers like dependencies

An MCP server is code that runs with your agent's access. Several MCP servers and agent frameworks have had remote code execution flaws in 2026, and malicious packages posing as MCP servers have appeared in public registries.

  • Install MCP servers only from publishers you trust, pin versions and review updates.
  • Prefer servers that run with their own minimal credentials over ones that inherit yours.
  • Do not let an agent add or configure MCP servers on its own.
  • Keep a list of approved servers and what each can reach.

4. Contain the runtime

  • Run agents in isolated environments: a container or VM per run, no access to the host.
  • Require IMDSv2 with a hop limit of 1 on cloud instances, so workloads cannot read instance credentials from the metadata service.
  • Apply an egress allowlist: the model endpoint and the APIs the task needs. Block everything else, including internal networks the agent has no reason to scan.
  • Set budgets and rate limits per agent, so a loop cannot run for hours.

5. Keep a human on the irreversible steps

Require explicit approval before payments, deletes, deploys, permission changes, or sending data outside the company. Show the approver the real parameters, not the agent's summary of them.

6. Log every step and be able to stop it

  • Log each tool call with its inputs, outputs and the identity used, in CloudTrail and your application logs.
  • Alert on denied calls, new destinations and unusual volume.
  • Give a named person the authority and the button to stop a run, and rehearse it.

7. Put it in writing

Add autonomous agents to your acceptable use policy: which systems they may act on, which outside targets they may test (only with written permission), and who is accountable for what an agent does. In November 2026 an engineer's testing agents probed a rival's internal systems; the apology came from the CEO.

What WardBee checks

On AWS, WardBee checks the controls that contain an agent's blast radius: IMDSv2, administrative and privilege-escalation IAM policies, full Bedrock access, Bedrock agent roles and guardrails, long-term Bedrock API keys, CloudTrail and GuardDuty. Results map to ISO 27001 and SOC 2 controls for access management and logging.

What WardBee checks for this playbook

  • EC2 instance requires IMDSv2 or has the instance metadata service disabledec2_instance_imdsv2_enabled
  • Customer managed IAM policy does not allow actions that can lead to privilege escalationiam_policy_allows_privilege_escalation
  • Inline IAM policy does not allow '*:*' administrative privilegesiam_inline_policy_no_administrative_privileges
  • IAM role does not have AmazonBedrockFullAccess managed policy attachedbedrock_full_access_policy_attached
  • Amazon Bedrock agent execution role follows least privilegebedrock_agent_role_least_privilege
  • Amazon Bedrock agent uses a guardrail to protect agent sessionsbedrock_agent_guardrail_enabled
  • Amazon Bedrock long-term API key has expiredbedrock_api_key_no_long_term_credentials
  • Region has at least one CloudTrail trail loggingcloudtrail_multi_region_enabled

Runs on each AWS sync while a framework it maps to, such as ISO 27001, is enabled. Run it on your account

Related standards: OWASP Top 10 for LLM Applications · ISO/IEC 42001

More playbooks

Check this playbook against your own AWS account.

WardBee connects read-only to AWS and, if you choose, to GitHub or GitLab, and shows which of these controls pass, fail or still need a person, as ISO 27001 and SOC 2 evidence.

What's new · v1.0.0

ScanComb and WardBee 1.0: compliance checks, TISAX and SOC 2 readiness, and a new public site

This is the first release of ScanComb and WardBee. WardBee brings automated compliance checks, framework workspaces, reports and task tracking for engineering, security and compliance teams. scancomb.com adds free checks and a TISAX readiness check, plus guides and news.

Highlights

  • TISAX readiness check Answer a public questionnaire and get a free readiness score by email. A paid report adds findings, an action plan for each chapter, a roadmap and a PDF. You can import the gaps into a WardBee workspace as tasks.
  • Dedicated TISAX section in WardBee Manage TISAX in one place. Set the scope, keep a self-assessment register, follow an action plan with tasks, track audits and labels, and manage suppliers and exports.
  • SOC 2 readiness Work through a readiness questionnaire, criterion guidance, a policy pack and reviews. Criteria are explained in plain words and questions can be answered in the side drawer. You can download a SOC 2 readiness report as a PDF.
  • Sovereignty Profile free check Run the free Sovereignty Profile check and get a report. The scores are explained in plain words.
  • Projects with a shared scan pool Run several projects or clients in separate workspaces that share one pool of scans. A For consultants page explains the setup.

Improvements

  • Resource inventory See an inventory of your resources with filters, saved views and notifications.
  • EU Cyber Resilience Act support Prepare for the EU Cyber Resilience Act with product classification and a continuous technical file.
  • NIS2 Supplier Check Assess suppliers against NIS2 with the NIS2 Supplier Check.
  • Free AI security check and AI Shield playbooks Take a free AI security check and read practical playbooks on AI agent permissions, prompt injection, shadow AI and more.
  • Manual control verification Verify controls that cannot be checked automatically, using a clearer drawer for manual controls.
  • Clearer controls and findings Findings and resource names are easier to read, you can filter to checks-only scans, and you can compare one scan with the previous one.
  • Faster control and dashboard pages Controls, the dashboard and risks load faster. App pages show a loading state right away.
  • Better start for new workspaces New workspaces start with ISO 27001 and SOC 2, with an explanation of what scans do. If no frameworks are chosen, a Choose frameworks step guides you.
  • Support tickets, announcements and notification bell Open support tickets inside WardBee and get email updates. Announcements appear in a header bell.
  • New site design, menu and guides scancomb.com has a new look and a grouped menu with News, Free checks and Guides. WardBee uses the same visual style, and the in-app docs are task-focused guides.
  • What's New and Framework Watch A What's New dialog shows release notes on scancomb.com. A weekly Framework Watch news issue is also published.
  • Team invitations and two-factor sign-in Invite teammates by email with consistent role names. Two-factor setup includes a QR code.

Fixes

  • Security improvements to sign-up and sign-in Sign-up and sign-in are now better protected.
  • More accurate AWS multi-factor authentication checks All MFA device types are now recognized, and users who only use programmatic access are no longer flagged.
  • Confirmed failures are shown correctly A confirmed failure now outranks an error in a control's status.
  • One critical-control email per scan You now get a single critical-control email per control for each scan.
  • Smoother onboarding and failed checks Workspaces without frameworks are sent to setup. Checks that fail are refunded, and queued checks show as Queued.
  • Correct access errors Signed-out or unauthorized requests now get a proper access error instead of a server error.