# Default safety check

Use Do Not Act as the Risk Gateway before an autonomous prediction-market agent continues.

The default integration rule is simple:

```text
call donotact_preflight with venue, market_id, side, requested notional and policy

if DoNotAct verdict or Risk Gateway decision is DO_NOT_ACT or INSUFFICIENT_EVIDENCE:
    stop automated action
    preserve evidence
    surface the reason to the operator
```

Do Not Act is the control layer before the agent spends: action context in, stop/go decision out. The caller keeps execution, custody and signing outside Do Not Act.

## Direct HTTP

```bash
curl -sS   -H "X-API-Key: $DONOTACT_API_KEY"   -H "X-DONOTACT-Source: my-agent/0.1.0"   https://donotact.com/v1/dispute/polymarket/580810
```

Action-aware preflight should be the default gate:

```bash
curl -sS \
  -H "X-API-Key: $DONOTACT_API_KEY" \
  -H "X-DONOTACT-Source: my-agent/0.1.0" \
  "https://donotact.com/v1/preflight/polymarket/906974?intent=enter&side=yes&notional_usd=2500&max_slippage_bps=75&policy=balanced&horizon=intraday"
```

Expected guard behavior:

```python
decision = response.get("decision") or response.get("verdict")

if decision != "READY":
    raise RuntimeError({
        "source": "donotact",
        "decision": decision,
        "reasons": response.get("no_trade_reasons", []),
        "blocking_reasons": response.get("blocking_reasons", []),
        "safe_operating_limits": response.get("safe_operating_limits"),
        "what_would_change_this": response.get("what_would_change_this", []),
    })
```

## Python one-liner path

```python
from donotact import DoNotActClient

client = DoNotActClient(api_key=os.environ["DONOTACT_API_KEY"], source="my-agent/0.1.0")
decision = client.agent_guard("polymarket", "580810", register_watchlist=True)

if not decision.can_continue:
    raise RuntimeError(decision.reason)
```

## JavaScript one-liner path

```js
import { DoNotActClient } from "donotact";

const client = new DoNotActClient({
  apiKey: process.env.DONOTACT_API_KEY,
  source: "my-agent/0.1.0"
});

const decision = await client.agentGuard("polymarket", "580810", {
  registerWatchlist: true
});

if (!decision.canContinue) {
  throw new Error(decision.reason);
}
```

## MCP-compatible agents

Expose these tools to the agent runtime:

- `donotact_preflight`
- `donotact_resolution_risk`
- `donotact_dispute`
- `donotact_watchlist_add`
- `donotact_alerts`

Minimal policy:

```text
1. Call donotact_preflight before the agent continues on a market.
2. Include intended side, requested notional, slippage policy and horizon when known.
3. Continue only if verdict/decision is READY.
4. If continuing on a monitored market, register donotact_watchlist_add.
5. Use donotact_dispute for focused UMA lifecycle checks.
6. Poll donotact_alerts or consume the configured webhook before further automated steps.
```

## n8n template

Use `/examples/n8n-dispute-guard-workflow.json` as a starter workflow. It now uses the action-aware Risk Gateway preflight, branches on `decision`/`verdict`, and stops unless the response is `READY`.

## Public proof before integration

- Public index: `/dispute-risk`
- JSON index: `/dispute-risk.json`
- Black-box proof: `/docs/integration-proof`
- Why paid access exists: `/docs/why-pay`

---

## Agent Discovery

- llms.txt: `/llms.txt`
- Full context: `/llms-full.txt`
- Agent manifest: `/agent.json`
- OpenAPI: `/openapi.json`
- Discovery docs: `/docs/discovery`
