agent-least-privilege

agent-least-privilege is a skill for Claude Code, Codex from MLOps-Courses/agentops-open-course. It costs 73 tokens per session (573 once invoked), scanned A, original, MIT.

A security design guide for splitting an AI agent into a coordinator and specialist agents with different permissions. The reading specialist handles untrusted content, while the acting specialist receives only the tools needed to make changes.

In plain words
What is it for?
Design safer agent workflows, separate reading from writing actions, route tasks to specialists, and keep consequential changes behind policy checks.
Why use it?
It limits the damage an injected instruction can cause by ensuring an agent cannot use tools it was never given.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mlops-courses/agentops-open-course/agent-least-privilege
Any agent
npx skills add MLOps-Courses/agentops-open-course --skill agent-least-privilege
Clone the repo
git clone --depth 1 https://github.com/MLOps-Courses/agentops-open-course

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-least-privilege

README.md
[![agentmods](https://agentmods.dev/badge/skills/mlops-courses/agentops-open-course/agent-least-privilege.svg)](https://agentmods.dev/skills/mlops-courses/agentops-open-course/agent-least-privilege)
Your own site
<a href="https://agentmods.dev/skills/mlops-courses/agentops-open-course/agent-least-privilege"><img src="https://agentmods.dev/badge/skills/mlops-courses/agentops-open-course/agent-least-privilege.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 573 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.00573
Opus 5 $0.00036 $0.00287
Sonnet 5 $0.00015 $0.00115
Haiku 4.5 $0.00007 $0.00057

Measured 6d ago against content hash cd5f3ab84846, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agent-least-privilege scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agent-least-privilege/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Least Privilege

Split work by authority, not because a diagram looks tidier. A boundary a model could talk itself across is prose; a boundary enforced by which tools an agent physically holds is policy.

When to use

  • One agent holds both readers of attacker-influenceable content and consequential write tools.
  • You want an injected instruction to have nothing to call, by construction.
  • You are unsure whether to split an agent or keep it single (see "When one agent is better").

Steps

  1. Separate reading from acting. Give the agent that reads untrusted content (logs, web, tool output) no write tools; give the agent that can act no raw-content readers. An injection reaching the reader then has nothing to invoke.
  2. Route by description, and keep policy in the coordinator. A coordinator delegates to specialists whose description fields the model matches the task against — write them precisely. Keep the policy (diagnose before remediate) in the coordinator's instruction, not in the model's discretion.
  3. Keep writes gated even after the split. Least privilege limits capability, not content: the injected text still circulates in shared history. So the acting agent's writes still require human approval, and you still spotlight untrusted output.
  4. Share one budget. Delegation multiplies model calls; carry one shared token ceiling across all sub-agents so a chain that keeps hopping still hits a single limit.

When one agent is better

Most of the time. Every delegation is an extra model call and another candidate author for a wrong answer. Split only when tool sets must differ in authority, one instruction has grown contradictory, or a sub-task needs a different model/budget. Otherwise prefer one agent with well-guarded tools.

Reference implementation

From the AgentOps Open Course, installable with npx skills add MLOps-Courses/agentops-open-course:

  • agents/go/compose/delegation.go — a coordinator with structurally restricted specialists.
  • Course chapter 3.7. Multi-Agent.

Read the full file on GitHub · 37 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 37 lines · 73 tokens per session scan A cd5f3ab84846

Subscribe to this mod's changes

agent-least-privilege is a skill published in the GitHub repository MLOps-Courses/agentops-open-course (2 stars, last pushed 4d ago), licensed MIT. It adds 73 tokens to every session and 573 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories