# Interceptor Sandbox

Interceptor gives an AI agent a controlled world to operate in. It runs the agent
in a container with declared services, files, identities, and data, then records
how it interacts with that world.

## Simulate the dependencies the agent needs

An agent may depend on HTTP APIs, MCP tools, a database, model providers, and files.
The environment blueprint describes those dependencies and how to invoke the agent.
Interceptor provides the supported simulated services inside the environment,
including managed PostgreSQL/pgvector, so you do not need a separate database server
for a supported database-backed target.

Model and embedding computation can use explicitly configured host-side provider
connections. Declared HTTPS seams can reach particular external services. These
connections are distinct from simulated services and do not provide general network
access to the target.

## Inject payloads at controlled boundaries

Interceptor's injection API lets you place test payloads into the information an
agent receives and the environment it uses. This supports indirect prompt-injection
testing as well as operational simulations, such as checking how an agent handles
malformed tool calls, unexpected data, or identity failures. You or the campaign
harness author the payload; Interceptor controls its placement and records what
happened.

| Injection surface | What you can change |
| --- | --- |
| Model responses (`model_response`) | Native model output before the agent's SDK or tool dispatcher receives it, including tool-call names and arguments. Use this to exercise unknown tools, malformed arguments, or unexpected response structures. |
| Tool results sent to the model (`model_tool_result`) | A matching tool result just before it reaches the model, without changing the stored source data. |
| Native MCP results (`mcp_tool_result`) | A successful MCP tool result after the tool executes and before the application consumes it. |
| HTTP service responses (`service_response`) | Successful managed HTTP responses or enabled dynamic attacker-service responses before the application consumes them. |
| Database results (`database_response`) | Supported text and JSON cells in managed PostgreSQL query results, without changing stored rows or the query's actual outcome. |
| Environment state (`environment_state`) | Declared mutable service records, database fields, files, and supported synthetic identity state, which the agent then reads through its normal code paths. |

Response injections use **simulation** mode to change content in transit.
Environment-state injections use **fidelity** mode to change the session's actual
data while preserving the blueprint's seed assets. Removing a definition does not
undo a state change that has already been applied.

An injection definition selects a target, a placement, a payload, and a lifetime.
Depending on the surface, selectors can match a tool, arguments, service, request,
or call ordinal; placements can replace values, append or prepend text, merge
allowed fields, or insert array elements. Available operations and targets come
from the environment's advertised capabilities and policy. Definitions can apply
once or remain active for repeated matching calls. Interceptor records matching,
placement, and available delivery evidence; these facts alone do not establish
that an attack succeeded or a tool executed.

Use the API directly or through an Operator campaign. See the
[injection API reference](https://github.com/intrusiveai/interceptor_sandbox/blob/v0.1.5/docs/api-reference.md#post-v1injections),
[selectors, placement, and lifetime guidance](https://github.com/intrusiveai/interceptor_sandbox/blob/v0.1.5/docs/injections-and-evaluation.md),
and [database injection details](https://github.com/intrusiveai/interceptor_sandbox/blob/v0.1.5/docs/postgresql.md#injection-and-committed-state-checks)
for configuration. For attached campaigns, follow the
[local campaign API](https://github.com/intrusiveai/interceptor_sandbox/blob/v0.1.5/docs/local-api.md#attach-and-native-experiments).

## Observe and compare behavior

Interceptor records requests, responses, managed state changes, and target output.
Supported snapshots preserve declared logical state so experiments can start from
known conditions. They do not automatically capture process memory, open connections,
or remote service state.

You can operate Interceptor through its CLI and local API, or connect Operator for
campaigns driven by Attack Harness. Interceptor supplies the target environment;
the campaign supplies the investigation objectives.

## Bring your first agent

Follow [setup](guides/setup.md), [bring your agent](guides/bring-your-agent.md), and
[blueprint creation](guides/environment-blueprints.md). Use the
[service reference](guides/services.md) to model its dependencies and
[sessions and evidence](guides/sessions-and-evidence.md) to inspect it.

The [customer-support walkthrough](https://docs.intrusive.ai/pages/guides/attack-simulation-walkthrough.html)
shows these steps together with Operator and Attack Harness.
