CYART // SCHEMA · CICD-SUPPLY-CHAIN6 NODES · 5 LINKSPUSHTRIGGERSIGN (SIGSTORE)ADMISSION CHECKACTOR · Developer — signed commitsACTOR01Developersigned commitsDATA · Source control — branch protection, reviewDATA02Source controlbranch protection, reviewSERVICE · Build — hermetic, pinned depsSERVICE03Buildhermetic, pinned depsCONTROL · Scanners — SCA, SAST, secretsCONTROL04ScannersSCA, SAST, secretsDATA · Registry — signed image + SBOMDATA05Registrysigned image + SBOMEDGE · Deploy — verify sig + provenanceEDGE06Deployverify sig + provenance

Agent tool sandboxing and least privilege

Treat the model as an untrusted user acting with delegated authority: designing narrow tools, per-user scoped credentials, confirmation gates, code-execution sandboxes, network egress control, MCP server risks, and audit trails for agent actions.

🔒 PROBy ·Lesson·13 min read·Advanced → Staff
AI agentsexcessive agencytool sandboxingMCP securityconfused deputycode execution sandbox

01The model is an untrusted user with your keys

✓What you will learn
  • Apply a threat model in which the model is an untrusted principal acting with delegated authority
  • Design narrow tools with per-user, scoped credentials to avoid confused-deputy bugs
  • Sandbox code execution and control network egress for agents
  • Assess MCP servers and tool descriptions as supply-chain risk
  • Build confirmation gates and audit trails for agent actions

An agent is a loop: the model picks a tool and arguments, your code runs it, the result goes back into the context, repeat. Whatever the tools can do, an injected or simply mistaken model can do. OWASP calls the failure excessive agency (LLM06:2025): too much functionality, too many permissions, or too much autonomy. The working threat model is simple: treat every tool call as if an untrusted user had typed it, with the same validation and authorisation you would apply to a public API.

ExcessExampleFix
FunctionalityA support agent given a generic run_sql tool to look up ordersA get_order(order_id) tool that only reads the caller's orders
PermissionsThe agent's database user can write every tableRead-only role scoped to the tables the tools need
AutonomyRefunds issued without reviewRefunds above a threshold need human approval
IdentityAll users' requests run with one service accountAct with the end user's own delegated, scoped token

This is an advanced module

AI & LLM security engineering is part of the Pro pass. 4 more sections — the deep dives, the final design, follow-ups and the test — unlock with it.

Already a cyart.io or studio.cyart.io member? Your pass code is in your Studio account.