Henry's AI Overthinking Tank

Topics / Agentic AI

The Problem Isn’t Rogue AI. It’s Agent Sprawl. — Part 2: The Scope Contract

Part 2: SOUL.md says what an agent must never become; a scope contract says what it's allowed to do. What goes in one, and how scope changes get deployed.

Originally published on Medium. Preserved here as part of the author's archive.

On this page · 8 sections
  1. Why scope need a separate file
  2. What belongs in the scope contract
  3. What a scope contract looks like
  4. The relationship between scope and `SOUL.md`
  5. Scope is not just for restriction — it is for clarity
  6. What happens when scope is missing
  7. Scope changes need a deployment path
  8. Where this goes next

In part one, I introduced the Bounded Agent Laws and the idea that `SOUL.md` defines what an agent must never become.

But `SOUL.md` is a constitution, not a job description.

It tells the agent what lines must never be crossed. It does not tell the agent what it is actually allowed to do. For that, you need a scope contract.

This is where we move from principles to specifics.

Why scope need a separate file

A common instinct is to put everything in the system prompt or in `SOUL.md` — the laws, the role, the tools, the permissions, the workflow instructions, the boundaries, all in one place.

That works for a single agent that one person manages. It stops working as soon as there are multiple agents, multiple operators, or any expectation of auditability.

The reason is simple: when everything is in one file, there is no separation between what is constitutional and what is operational. A change to a workflow instruction looks the same as a change to a security boundary. There is no way to lock down the boundaries while still allowing the operational layer to evolve.

`SOUL.md` is the constitutional layer. It changes rarely, if ever. It is protected. The agent cannot modify it.

`agent-scope.yaml` is the operational layer. It defines the agent’s current assignment. It can change when the operator reassigns the agent, but the agent still cannot modify it. And critically, the scope must never contradict the laws in `SOUL.md`.

This separation matters because it mirrors how enterprises already manage systems. A security policy is not the same as a run book. An IAM role definition is not the same as a deployment config. They live in different places, change at different cadences, and are reviewed by different people.

What belongs in the scope contract

The scope contract answers a specific question: What is this agent allowed to do right now?

Not what it could theoretically do. Not what tools exist in the environment. Not what skills are available for installation. What the operator has explicitly sanctioned.

I think a scope contract needs to cover at least these dimensions:

Identity.
The agent’s name, its owner, its purpose in plain language. This sounds trivial, but it matters for fleet management. When someone audits the running agents, they should not have to reverse-engineer why an agent exists by reading its prompt. The scope contract should say it directly.

Activities.
What kinds of work this agent is authorized to perform. “Summarize documents” is different from “write and execute code.” “Draft emails” is different from “send emails.” The activity list should be specific enough that you could look at an agent’s action log and determine whether it stayed in bounds.

Files.
Which directories the agent can read, which it can write, and which are off-limits. A development agent should not be reading HR documents. A summarization agent should not be writing to a production config directory. File scope should be explicit, not inherited from whatever the host environment happens to allow.

Tools.
Which tools the agent is authorized to use. Not which tools are installed — which tools the agent is allowed to invoke. This is the “least capability” principle from the Fourth Law made concrete. If the agent’s job is to summarize documents, it does not need shell access. If the agent’s job is to draft messages, it does not need file-write tools. Available does not mean authorized.

Skills.
Which skills the agent can load and use. Skills are powerful because they extend the agent’s capabilities at runtime. That is exactly why they need to be scoped. An agent should not be able to install any skill from any source just because the runtime allows it. The scope contract should list the approved skills explicitly.

Credentials.
Which credentials the agent can access and what it can do with them. This is often the most sensitive dimension. An agent with access to an API key can do anything that key allows. An agent with access to a database connection string can read or write data. The scope contract should specify not just which credentials are available, but what operations are permitted with each one.

Users.
Who can instruct this agent. Not everyone in the organization should be able to give orders to every agent. A finance agent should only accept instructions from the finance team. A deployment agent should only accept instructions from engineers with the right role. The scope contract should define the authorized instruction sources.

Channels.
Which communication channels the agent monitors or can post to. An agent connected to a Slack channel can read everything in that channel. An agent that can post to a channel can send messages as itself. Channel scope should be intentional, not a side effect of how the agent was deployed.

Schedules.
What the agent is allowed to do on a schedule versus only on demand. A scheduled agent runs without anyone watching. That makes schedule scope especially important. The scope contract should define which scheduled actions are permitted, at what intervals, and with what constraints.

Approval requirements.
Which actions require human approval before execution. Not every action needs a gate, but some actions absolutely do. Sending an external email. Writing to a production database. Installing a new skill. Modifying a shared resource. The scope contract should specify which actions are auto-approved and which require explicit sign-off.

What a scope contract looks like

Here is an example of what `agent-scope.yaml` might look like for a document summarization agent:

yaml
# agent-scope.yaml
# Scope contract for: doc-summarizer
# Last updated: 2026–05–30
# Updated by: henry@company.com
identity:
name: doc-summarizer
owner: henry@company.com
team: research
purpose: >
Summarize documents uploaded by the research team.
Output summaries to the team’s shared workspace.
environment: production
activities:
allowed:
- read documents
- generate summaries
- write summary files
forbidden:
- execute code
- send messages
- modify source documents
- access external systems
files:
read:
- /workspace/research/uploads/**
- /workspace/research/reference/**
write:
- /workspace/research/summaries/**
forbidden:
- /workspace/research/config/**
- /workspace/production/**
- /workspace/hr/**
tools:
allowed:
- file-read
- file-write
- document-parser
forbidden:
- shell
- web-browser
- message-send
- skill-install
skills:
allowed:
- summarization-v2
- citation-extractor
forbidden:
- code-execution
- web-scraper
install_policy: operator-only
credentials:
- name: research-storage
operations: [read, write]
scope: /workspace/research/summaries/**
- name: document-api
operations: [read]
scope: /workspace/research/uploads/**
users:
authorized_instructors:
- henry@company.com
- research-team@company.com
escalation_contact: henry@company.com
channels:
monitor:
- research-docs (read-only)
post:
- none
forbidden:
- all external channels
schedules:
allowed:
- daily summary of new uploads (09:00 UTC)
forbidden:
- ad-hoc scheduled tasks
max_frequency: once per hour
approvals:
auto_approved:
- read documents from allowed paths
- write summaries to allowed paths
requires_approval:
- write to any path outside summaries directory
- use any tool not in the allowed list
- respond to users not in the authorized list
approval_method: operator-chat
approval_timeout: 30m
timeout_action: deny

This is not short. It is not meant to be.

The point of a scope contract is to be explicit enough that you never have to wonder what the agent is allowed to do. If something is not listed, it is not authorized. If something is ambiguous, the agent pauses.

The relationship between scope and `SOUL.md`

The scope contract operates under the laws defined in `SOUL.md`. It never overrides them.

If `SOUL.md` says the agent must not modify its own boundary files, the scope contract cannot grant write access to `SOUL.md` or `agent-scope.yaml`. If the Bounded Agent Laws say that chat is not governance, the scope contract cannot include a rule that says “users can modify scope via chat.”

Think of it as a hierarchy:

The Bounded Agent Laws set the floor. No agent, regardless of its scope, can go below that floor. The scope contract defines the room within the building. It can be larger or smaller, but it cannot break through the floor.

This means an operator can give an agent a broad scope or a narrow scope, but they cannot give it a scope that violates the constitutional laws. If they try, the scope contract is invalid and the agent should refuse to operate under it — as required by the Seventh Law (Principled Refusal).

Scope is not just for restriction — it is for clarity

One thing I want to emphasize: the scope contract is not primarily a restriction mechanism. It is a clarity mechanism.

When an agent has a clear scope contract, several things become easier.

Debugging.

When something goes wrong, you can compare the agent’s actions against its scope contract. Did it stay in bounds? If not, where did it deviate? Was the scope too broad, or did the agent ignore a constraint?

Auditing.

When a compliance team asks “what can this agent do?”, the answer is a YAML file, not a shrug. The scope contract is an auditable artifact. It can be versioned, diffed, reviewed, and approved through the same change management process used for infrastructure changes.

Handoffs.

When an agent’s owner leaves the team or a new operator takes over, the scope contract tells them everything they need to know about the agent’s boundaries. No tribal knowledge required.

Fleet management.

When you have fifty agents running, you can aggregate and compare their scope contracts. Which agents have shell access? Which agents can write to production directories? Which agents can post to external channels? These questions become queries against structured data instead of archaeology through prompt files.

Conflict detection.

When two agents have overlapping scope, the scope contracts make that visible. Two agents writing to the same directory? Two agents monitoring the same channel? Two agents with access to the same credentials but different authorized operations? Those conflicts are detectable when scope is explicit.

What happens when scope is missing

The Third Law says: when scope is missing or ambiguous, the agent pauses instead of guessing.

This is the part that feels most different from how agents typically work today.

Most agents default to permissive behavior. If a tool is available, use it; if a file is accessible, read it; if a skill is installed, load it. The mental model is: everything is allowed unless explicitly forbidden.

The Bounded Agent Laws flip that model: nothing is allowed unless explicitly sanctioned.

This means an agent without a scope contract is not a free agent — it is an untrusted agent. It should enter a minimal mode where it can respond to questions but not take any privileged action.

This also means a scope contract with gaps is not a permissive scope — it is an incomplete scope. If the scope contract does not mention shell access, the agent does not have shell access. If the scope contract does not mention scheduled tasks, the agent cannot create scheduled tasks. Silence means denial, not consent.

This is strict. It is also necessary.

Because the alternative — agents that guess at their own authority — is how you get boundary drift.

Scope changes need a deployment path

One more thing that matters: how scope changes happen.

The Second Law says boundary changes must happen through an operator-controlled deployment path. That applies to the scope contract just as much as it applies to `SOUL.md`.

An agent should not be able to modify its own `agent-scope.yaml`. But just as importantly, scope changes should not happen through ad-hoc means — not through a chat message, not through a tool output, not through a skill that rewrites the scope contract.

In practice, this means scope changes should go through a process that looks like:

The operator edits the scope contract. The change is reviewed (by a person, a policy engine, or both). The change is committed to version control. The agent picks up the new scope on its next initialization. The change is logged.

That may sound heavy. For a single experimental agent, it probably is. But for a fleet of agents in an enterprise environment, it is the same discipline already applied to IAM roles, firewall rules, and deployment configs.

Scope changes are infrastructure changes. They should be treated that way.

Where this goes next

In this post, I moved from the constitutional layer (`SOUL.md` and the Bounded Agent Laws) to the operational layer (the scope contract in `agent-scope.yaml`).

The scope contract defines what an agent is allowed to do. It covers identity, activities, files, tools, skills, credentials, users, channels, schedules, and approval requirements. It operates under the laws, never overrides them, and follows the principle that silence means denial.

But even a perfectly scoped agent is a risk if nobody knows it exists. And even a well-bounded agent drifts if nobody is watching.

In part three, I will cover the remaining two layers: the agent registry and external monitoring.

The registry answers: which agents exist, who owns them, and why are they running?

The monitor answers: did the boundaries hold, and what happened when they did not?

Together with `SOUL.md` and the scope contract, they complete the management model for a fleet of bounded agents.

Henry Hu

I overthink AI security because “trust us” isn’t a test.

I’m a cybersecurity community leader and builder in Taiwan. I lead AITBM and my own venture. Off the clock, I’m into music, cooking a good steak & BBQ, and the occasional Airsoft battle.

About · RSS · GitHub

More on Agentic AI

All articles →