Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

docs(agent-proxy): document the canceled decision and the agent's own sandbox layer (#7524)

Saif Ur Rahman5b363cc2e27a
diff --git a/docs/cli/commands/agent-proxy.mdx b/docs/cli/commands/agent-proxy.mdx
index 2148de3e73..bc0326ebdf 100644
--- a/docs/cli/commands/agent-proxy.mdx
+++ b/docs/cli/commands/agent-proxy.mdx
@@ -334,7 +334,7 @@ $ infisical secrets agent-proxy start --port 17322 --unmatched-host=block
</Accordion>
<Accordion title="--log-level">
- Controls how much is logged. Each [activity decision](/documentation/platform/agent-proxy/activity-logs) maps to a level (`passthrough`=debug, `brokered`=info, `blocked`=warn, `error`=error), so this doubles as the activity filter: `debug` shows everything, the default `info` hides passthrough, `warn` shows only blocked and errors.
+ Controls how much is logged. Each [activity decision](/documentation/platform/agent-proxy/activity-logs) maps to a level (`passthrough`=debug, `canceled`=debug, `brokered`=info, `blocked`=warn, `error`=error), so this doubles as the activity filter: `debug` shows everything, the default `info` hides passthrough and canceled requests, `warn` shows only blocked and errors.
```bash
# Example
diff --git a/docs/documentation/platform/agent-proxy/activity-logs.mdx b/docs/documentation/platform/agent-proxy/activity-logs.mdx
index 18b43d283b..04a89bdd2e 100644
--- a/docs/documentation/platform/agent-proxy/activity-logs.mdx
+++ b/docs/documentation/platform/agent-proxy/activity-logs.mdx
@@ -17,12 +17,12 @@ Each request is logged with these fields (plus the standard `time`, `level`, and
| Field | Meaning |
| --- | --- |
| `event` | Always `agent-proxy.request`, so activity is easy to filter from other logs |
-| `decision` | `brokered`, `passthrough`, `blocked`, or `error` |
+| `decision` | `brokered`, `passthrough`, `blocked`, `canceled`, or `error` |
| `agentId` / `agentName` | Who made the request: the agent's machine identity behind a standalone proxy, or your own account (or `token`) on a local proxy |
| `projectId` / `environment` / `secretPath` | The folder the request was scoped to |
| `serviceName` / `serviceId` | The matched proxied service (omitted when none matched) |
| `method` / `host` / `port` / `path` | The request line, before substitution (so `path` shows the placeholder) |
-| `status` | Upstream status on `brokered` / `passthrough`; `403` on `blocked`; `502` on `error` |
+| `status` | Upstream status on `brokered` / `passthrough`; `403` on `blocked`; `502` on `error`; omitted on `canceled`, where no response was ever returned |
| `credentials` | What was injected: each entry's secret key (or, for a dynamic secret, its name and output field), and the header or surfaces it landed in |
Written out, two records look like this:
@@ -38,15 +38,18 @@ Written out, two records look like this:
## Log levels
-Each decision is logged at a level, so `--log-level` controls how much you see: the default `info` hides passthrough, `debug` shows everything, `warn` shows only blocked and errors.
+Each decision is logged at a level, so `--log-level` controls how much you see: the default `info` hides passthrough and canceled requests, `debug` shows everything, `warn` shows only blocked and errors.
| decision | level |
| --- | --- |
| `passthrough` | debug |
+| `canceled` | debug |
| `brokered` | info |
| `blocked` | warn |
| `error` | error |
+`canceled` means the agent hung up before the request finished, which happens when you interrupt a prompt or the agent exits mid-request. Nothing failed and there was nobody left to answer, so these stay at debug and off your terminal. A request that really failed, an unreachable upstream or permissions that could not be resolved, is still an `error`.
+
## Where the records go
### Local proxy
diff --git a/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx b/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx
index dcf9a626be..161f6aeed5 100644
--- a/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx
+++ b/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx
@@ -139,7 +139,7 @@ A per-run `0700` temporary directory holds the only things that touch disk:
## The sandbox
-The sandbox is on by default, and it is what makes brokering safe when the proxy and the agent share a machine. Its restrictions are deliberate, and a few are surprising the first time, so this is the part worth reading before you use `run` for real work.
+The sandbox is on by default, and it is what makes brokering safe when the proxy and the agent share a machine. `run` applies it to the agent process before the agent starts, and the operating system extends it to every command the agent runs, so nothing inside the agent can lift it, including an agent's own sandbox settings. Its restrictions are deliberate, and a few are surprising the first time, so this is the part worth reading before you use `run` for real work.
```text
|
@@ -302,11 +302,11 @@ infisical secrets agent-proxy run -e dev --log-file=/tmp/broker.log -- claude
tail -f /tmp/broker.log
```
-Every request records a decision: `brokered` (a service matched and a credential was applied), `passthrough` (no service matched, forwarded untouched), `blocked` (rejected by `--unmatched-host=block`), or `error`. Records carry the same fields as in [Activity Logs](/documentation/platform/agent-proxy/activity-logs), written in the human-readable console format.
+Every request records a decision: `brokered` (a service matched and a credential was applied), `passthrough` (no service matched, forwarded untouched), `blocked` (rejected by `--unmatched-host=block`), `canceled` (the agent hung up before the request finished), or `error`. Records carry the same fields as in [Activity Logs](/documentation/platform/agent-proxy/activity-logs), written in the human-readable console format.
Without `--log-file` you still see problems: warnings and errors print to your terminal, including a credential the proxy had to skip and a dropped authorization. What you lose is the per-request trail, so reach for `--log-file` when you need to see what happened on a specific request.
-`passthrough` is the one decision left out by default, and it is usually the bulk of an agent's traffic, so a log stays small. `--log-level debug` adds it, which is useful when you are working out why a host is not being brokered and noisy the rest of the time.
+`passthrough` and `canceled` are left out by default. Passthrough is usually most of an agent's traffic, so leaving it out keeps a log small, and a cancellation just means the agent hung up. `--log-level debug` adds both, which is useful when you are working out why a host is not being brokered and noisy the rest of the time.
<Note>
A path you pass to `--log-file` is appended to on every run and never rotated for you, so rotate it with `logrotate` (`copytruncate`) if you keep one around.
@@ -346,6 +346,10 @@ Without `--log-file` you still see problems: warnings and errors print to your t
</Accordion>
<Accordion title="The agent cannot read a file it needs">
It is probably in a denied credential path. Re-open just that file with `--allow-read <path>`. Reach for `--no-sandbox` last, not first.
+
+ Some agents run a sandbox of their own inside this one, and a denied file looks the same in both. Faced with one, an agent will often assume its own sandbox is too strict and run the command a second time with that sandbox switched off. That does not help: this sandbox is still in force, so the command fails exactly as it did the first time.
+
+ On macOS an agent usually cannot start its own sandbox at all under `run`, because macOS does not allow a second sandbox inside an existing one. Most agents warn about it and carry on without it, which costs you nothing, since this sandbox is the one protecting your credentials. If your agent is set to quit when its sandbox is unavailable, switch that off before you run it here.
</Accordion>
</AccordionGroup>