How AI's Actually Work — HAAW

Safety Boundaries and Sandboxes

How Do We Limit What an AI System Can Affect?

We have given an AI system a mission, tools, permissions, an autonomy envelope and perhaps enough persistence to operate for days or weeks. That raises an unavoidable engineering question: What happens when it makes a mistake? One answer is to design the surrounding system so that even a capable agent cannot reach everything.

A safety boundary does not merely tell the AI what not to do. It limits what the system allows the AI to affect.

Instructions Are Not the Same as Containment

Suppose an agent is told:

“Diagnose the HAAW web server. Do not modify production.”

That instruction matters. But we can build a stronger boundary by also making production modification technically unavailable.

Instruction Boundary

The agent is told not to perform an action.

Permission Boundary

The credentials or control system do not authorize the action.

Isolation Boundary

The environment is arranged so the protected resource is not reachable from the agent's execution space.

“Do not touch it” and “you cannot reach it” are different kinds of protection.

What Is a Sandbox?

A sandbox is a restricted execution environment designed to limit what a program or process can access or affect.

The exact mechanism varies. A sandbox may use operating-system permissions, containers, virtual machines, restricted user accounts, filesystem isolation, network controls, API gateways, capability restrictions, resource quotas, or combinations of these.

The useful HAAW idea is simpler:

UNTRUSTED OR LIMITED WORK
↓
CONTROLLED EXECUTION ENVIRONMENT
↓
ONLY SPECIFIC RESOURCES ARE REACHABLE

The Sandbox Is Not the Model

The transformer does not create the sandbox. The sandbox belongs to the surrounding computer system.

MODEL INFERENCE → ACTION REQUEST → ORCHESTRATOR → SANDBOX / PERMISSION BOUNDARY → TOOL EXECUTION

The model may request an operation outside the allowed environment. The important engineering question is what happens next.

A request crossing the boundary should fail at the boundary—not succeed because the model asked confidently.

Filesystem Boundaries

Imagine an AI coding agent that needs to modify one project.

Instead of exposing the entire machine:

/home/craig/
/etc/
/var/
/other-projects/
/credentials/
/backups/

the execution environment might expose only:

/workspace/haaw-project/

The agent can read and write inside the workspace while unrelated files remain outside its reachable namespace or permissions.

This reduces the blast radius of a bad command, mistaken path or incorrect model decision.

Blast Radius

Borrowing a useful engineering term, blast radius describes how much of the surrounding system can be affected when something goes wrong.

Large Blast Radius

Administrator credentials, broad filesystem access, unrestricted network access, many powerful tools.

Small Blast Radius

Dedicated workspace, narrow credentials, selected tools, limited network destinations, resource quotas.

Safety engineering often asks not only “Can this fail?” but “If it fails, how far can the failure travel?”

Operating-System Identity Is a Boundary

Our earlier permissions discussion now reaches the operating system.

An agent running as an ordinary restricted account should not automatically possess the powers of root or an administrator.

AGENT PROCESS → OS IDENTITY → FILES / PROCESSES / DEVICES / NETWORK RESOURCES

The operating system can enforce access rules regardless of whether the model “understands” those rules.

This is an important theme throughout HAAW:

Control does not have to depend entirely on model judgment.

Containers and Virtual Machines

Two common isolation approaches are containers and virtual machines, although their security properties and implementations differ.

MechanismConceptual Role
ContainerProvides an isolated userspace environment while typically sharing the host operating-system kernel.
Virtual MachineProvides a virtualized machine with its own guest operating system, separated through a hypervisor or virtualization layer.

Neither word automatically means “perfectly safe.” Configuration matters, vulnerabilities exist, and boundaries can be weakened by what is deliberately mounted, connected or permitted.

Network Sandboxing

A filesystem sandbox does little good if the agent has unrestricted network access and powerful remote credentials.

Network boundaries can restrict:

AGENT → NETWORK POLICY → APPROVED DESTINATIONS ONLY

This again separates capability from reachability. The model may know how to request something that the network architecture simply will not allow.

Credentials Are Capabilities

A password, API token, certificate or cloud role can turn a harmless-looking tool into a powerful one.

Therefore a sandbox should not casually contain credentials that exceed the mission's needs.

Least privilege applies to credentials as much as it applies to files and commands.

A read-only diagnostic mission may need credentials that can inspect service state. It probably does not need credentials that can delete infrastructure, change billing, create users or alter security policy.

Tool Boundaries

Another containment strategy is not to provide a general-purpose command interface at all.

Compare:

Broad Tool

shell(command)

The requested command may potentially do many different things depending on environment and privileges.

Narrow Tool

service_status(name)

The operation exposes one deliberately constrained capability.

A capability array made of narrow tools can make the permitted action surface easier to reason about and audit.

Read, Write, Execute — Then Ask What Changed

Our refined HAAW model fits naturally here:

REQUEST → AUTHORIZE R / W / X → EXECUTE INSIDE BOUNDARY → Δ STATE? → VERIFY

The sandbox helps determine what R/W/X operations are even possible against the surrounding environment.

And our earlier correction remains important: Change is not simply another permission bit. It is a question about consequence.

STATE A → AUTHORIZED OPERATION → STATE B

What changed?

Resource Sandboxing

Files and networks are not the only things an agent can consume.

A controlled environment can also limit:

A resource limit constrains how much work or damage can accumulate even when each individual operation is technically allowed.

Time Is Also a Boundary

The persistence page added time to our autonomy envelope. A sandbox can do the same.

An execution environment might exist only for one task:

CREATE SANDBOX → LOAD APPROVED INPUT → RUN TASK → EXTRACT APPROVED OUTPUT → DESTROY SANDBOX

This is sometimes called an ephemeral environment: it is deliberately temporary.

Destroying the environment does not erase external effects that were already permitted—such as a message already sent or a database already changed. That is why isolation and external permissions must be considered together.

Input and Output Crossings Matter

A sandbox needs doors. Otherwise useful work cannot enter or leave.

Those doors are themselves security boundaries:

Input

Which files, prompts, packages, datasets or credentials are allowed in?

Output

Which files, messages, results or state changes are allowed out?

A sandbox with an unrestricted escape hatch is not much of a sandbox.

Human Approval Can Guard a Boundary Crossing

Suppose an agent develops and tests a configuration change entirely inside an isolated environment.

The transition to production can be a separate controlled event:

SANDBOX WORK → PROPOSED ARTIFACT → TEST / REVIEW → HUMAN APPROVAL → PRODUCTION DEPLOYMENT

This combines sandboxing with the authority and escalation mechanisms from the previous HAAW pages.

The boundary can turn “AI changed production” into “AI prepared a change; an authorized control path decided whether production changed.”

Sandbox Escape

No serious discussion of sandboxes should imply that isolation is mathematically perfect.

Software can contain vulnerabilities. A flaw in an operating system, container runtime, hypervisor, browser, tool, driver or surrounding service may allow an unexpected crossing of an intended boundary.

That is why containment is usually stronger when it uses layers rather than trusting one mechanism.

NARROW TOOLS
+ RESTRICTED IDENTITY
+ FILESYSTEM BOUNDARY
+ NETWORK POLICY
+ LIMITED CREDENTIALS
+ RESOURCE LIMITS
+ APPROVAL GATES
+ LOGGING / VERIFICATION

Defense in Depth

This layered strategy is commonly called defense in depth.

If one control fails, another may still limit the consequence.

MODEL ERROR → TOOL RESTRICTION → PERMISSION CHECK → SANDBOX → NETWORK / SYSTEM BOUNDARY → APPROVAL GATE

The point is not that every system needs every layer. The point is that safety does not have to rest on a single instruction or a single model decision.

Containment Versus Correctness

A sandbox does not make the model correct.

Inside a perfectly functioning sandbox, an agent can still:

The sandbox addresses a different question:

If the system is wrong, what can the wrong action reach?
Correctness reduces mistakes. Containment reduces the consequences available to mistakes. We need not confuse the two.

Testing the Boundary

A safety boundary should itself be tested.

Useful tests might ask whether the agent can:

A denied attempt is itself useful evidence that the boundary was exercised.

Long-Running Agents Make Boundaries More Important

A short-lived agent may make ten decisions. A persistent agent may make thousands of decisions across days or weeks.

Even if the probability of an error at any one step is small, more steps create more opportunities for unexpected behavior, stale assumptions, changed environments and failed tools.

That makes persistent controls valuable:

WAKE → REVALIDATE MISSION → REVALIDATE AUTHORITY → ENTER BOUNDED EXECUTION → ACT → VERIFY → SAVE STATE / WAIT

The WITNESS View

For WITNESS, a statement such as “the agent was sandboxed” is not enough.

The evidence should make the actual boundary reconstructable:

WITNESS should distinguish intended containment from observed containment.

A configuration may say the boundary existed. The event record should help establish what the running system could actually reach and what it actually affected.

The Boundary

We can now add another layer to the HAAW system:

MODEL proposes
ORCHESTRATOR interprets
AUTHORITY determines what may proceed
SANDBOX limits what execution can reach
TOOLS perform operations
ΔSTATE records what changed
VERIFICATION checks the result

The model can still be capable. The agent can still be autonomous. The mission can still persist.

But the surrounding computer system can deliberately make the reachable world smaller than the entire world available to the host organization.

We do not have to make every mistake impossible. We can make many mistakes unable to travel very far.

HAAW Checkpoint

Safety Boundary

A control that limits what a system can access, execute or affect.

Sandbox

A restricted execution environment designed to contain program or agent activity.

Blast Radius

The extent of the surrounding system that a failure or mistaken action can affect.

Least Privilege

Grant only the access and authority needed for the mission.

Ephemeral Environment

A temporary execution environment created for bounded work and later destroyed.

Defense in Depth

Multiple independent or overlapping controls so safety does not depend on one boundary.

Containment vs Correctness

Correctness asks whether the action is right. Containment asks how far a wrong action can reach.

Central Lesson

A sandbox does not merely ask the AI to behave. It constrains the environment in which behavior can have effects.