Execute a configured tool
Send an explicit JSON execution envelope to your own guard host. Use http://SIDECAR_HOST:8789, replacing SIDECAR_HOST with your configured local sidecar hostname; a Unix socket is also supported. A configured connection selects the upstream tool and its credentials; callers cannot supply arbitrary upstream URLs or authorization headers. This is a separate execution host from the read-only MCP interface. Managed guard execution is not available.
Request fields
Use Content-Type: application/json. Unknown top-level fields are rejected. Required fields have no implicit mode or operation default on HTTP.
| Field | Type / presence | Meaning / constraint |
|---|---|---|
| tool | string; required | Configured tool name; 1–256 UTF-8 bytes, no control characters or slash. |
| connection | string; required | Authorized connection handle; same identifier bounds as tool. Not a credential. |
| operation | read | write | unknown; required | Must match the configured route. Treat unknown as a write for idempotency. |
| args | JSON value; required | Upstream request arguments; at most 8 MiB of encoded JSON. |
| mode | observe | repair | strict; required | Policy for both inspection phases; observe does not mutate or block. |
| idempotency_key | string; required for write/unknown | 1–256 UTF-8 bytes, no controls; forwarded as Idempotency-Key. The upstream must enforce deduplication. |
| metadata | object; optional | Defaults to {}. Does not grant authority or configure the detector. |
| durability | reserved; omit | A non-null value is rejected. No durability service is selected through this request. |
Try a configured local read
Requires a running sidecar with conn_example/vendor.read already bound to a read operation. Replace both handles with your configured values. The response body comes from that upstream; there is no universal AGINDOW success JSON wrapper.
curl -i http://SIDECAR_HOST:8789/v1/guard \
-H 'Content-Type: application/json' \
--data '{"tool":"vendor.read","connection":"conn_example","operation":"read","args":{},"mode":"observe"}'Successful or passed-through response
The upstream HTTP status, content type and original body are returned when no policy halt applies. A vendor 4xx or 5xx can therefore be a completed upstream outcome. Inspect X-Agindow-Status separately from HTTP status. This illustrative 200 body belongs to a fictional upstream, not a fixed AGINDOW response schema.
{"id":"example-record","amount":2000}Diagnostic headers
Headers describe this call, not a protection guarantee. They may be absent when the host rejects a request before execution. Do not require numeric latency when the clock is unavailable.
| Header | Meaning |
|---|---|
| X-Agindow-Status | ok, repaired, degraded, bypassed or blocked. Current execution hosts do not apply selective repair. |
| X-Agindow-Mode | Resolved observe, repair or strict policy when supplied. |
| X-Agindow-Audit | Artifact ID, not a URL or promise of durable retention. |
| X-Agindow-Drift-Class | shape, semantic or unknown; present when drift evidence is available. |
| X-Agindow-Drift-Side | request, response or both; identifies which inspection phase found drift. |
| X-Agindow-Latency-Ms | Active guard overhead excluding upstream waits; numeric locally or unavailable. |
| X-Agindow-Latency-Clock | Clock source used by the remote execution host; may be unavailable. |
| X-Agindow-Outcome | Relative retained-outcome URL on a completed response halt. Read it; do not blindly replay a write. |
| X-Agindow-Upstream-Status | Original upstream status on a local sidecar response halt. |
| X-RateLimit-Limit / Remaining / Reset | When emitted by an authenticated remote host: allowance, remaining count and reset Unix seconds. |
| X-Agindow-Quota-Scope | isolate when emitted; limits are local to an execution instance, not a global quota guarantee. |
Policy refusal: HTTP 409
An AGINDOW policy refusal has X-Agindow-Status: blocked and exactly six string fields below. repair uses drift_blocked; strict uses drift_halted. Observe never produces a policy block. A request halt means no dispatch. A response halt means the upstream already completed; inspect the retained outcome. An upstream 409 alone does not establish an AGINDOW policy refusal.
{
"error": "drift_blocked",
"tool": "vendor.write",
"drift_class": "semantic",
"drift_id": "aud_example",
"hint": "Upstream completed. Inspect the retained outcome; do not blindly replay a write.",
"audit": "/v1/audit/aud_example"
}Request validation, capacity and transport errors
When the guard rejects a request before execution, it generally uses {"error":"code"}; framework limits or origin refusals may have a plain or empty body. Upstream bodies use the vendor format. Do not assume every non-2xx response is JSON or safe to retry.
| HTTP / code | Meaning | Next action |
|---|---|---|
| 400 invalid_request | Malformed JSON, unknown field, invalid/mismatched route operation, missing idempotency key or unsupported durability. | Fix the envelope before retrying. |
| 401 unauthorized | Connection/tool not admitted locally, or remote credential missing/invalid. | Check the handles and credential; do not switch tenants to retry. |
| 403 | Local Host/Origin refused, or remote authorization/plan restriction. | Use the intended local origin or resolve access with the host owner. |
| 404 not_found | Unknown route or missing retained evidence. | Check the path; a missing receipt does not prove non-execution. |
| 409 drift_blocked / drift_halted | Known policy refusal; distinguish request and completed response. | Inspect feedback and retained outcome; do not blindly replay. |
| 413 invalid_request or framework body limit | Envelope exceeds 8 MiB + 64 KiB, or arguments exceed the inspection bound. | Reduce the request; do not silently split a logical write. |
| 429 rate_limited | This remote execution instance has reached its request limit. | Wait for the indicated reset if present; preserve the same logical idempotency key. |
| 502 internal | Sidecar could not obtain/read an upstream response. | Outcome may be uncertain. Reconcile writes before retrying. |
| 503 internal / identity_unavailable | Guard or authentication unavailable. | Use an explicit SDK fallback if configured, with the same upstream-enforced key for writes. |
Limits and retry safety
The statistical guest is default; configure windows to detect. Configure detection separately; selecting a mode is insufficient. Response inspection requires a complete body within the configured size limit; streams, encoded or incomplete evidence can bypass inspection. A malformed whole body is not repaired. The local vendor timeout is 30 seconds. Client timeouts do not cancel an already completed vendor write. SDK remote helpers default to five seconds and require a caller-supplied fallback. Audit and outcome records have fixed retention limits and do not provide durable replay.