> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sec0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the Sec0 SDK and choose the right public import paths.

## Prerequisites

* Node.js >= 20
* npm, pnpm, or yarn

## Install

Install the unified package:

```bash theme={null}
npm install sec0-sdk
```

Sec0 ships as one package with stable subpath exports. Pick the integration surface that matches where you want enforcement to happen.

## Public Import Paths

| Import path                      | Use it for                                                                                |
| -------------------------------- | ----------------------------------------------------------------------------------------- |
| `sec0-sdk/policy`                | Parse and validate policy YAML                                                            |
| `sec0-sdk/middleware`            | Wrap tool servers and MCP runtimes                                                        |
| `sec0-sdk/guard`                 | Allow, redact, block, or escalate outbound messages, tool calls, MCP calls, and API calls |
| `sec0-sdk/instrumentation`       | Decorators, hop registry, `AgentManager`, and local or remote hop invocation              |
| `sec0-sdk/gateway`               | Network-edge enforcement, quotas, entitlements, AP2, and brokering                        |
| `sec0-sdk/agent-state`           | Encode, decode, and propagate canonical agent-state headers                               |
| `sec0-sdk/mandate-ap2`           | Build digests and verify AP2 mandate headers                                              |
| `sec0-sdk/audit`                 | Append-only NDJSON audit writing and upload helpers                                       |
| `sec0-sdk/signer`                | Ed25519 signing helpers and canonicalization utilities                                    |
| `sec0-sdk/otel`                  | OpenTelemetry bootstrap and span helpers                                                  |
| `sec0-sdk/core`                  | Adapter contracts for custom middleware integrations                                      |
| `sec0-sdk/integrations/openclaw` | OpenClaw or Moltbot hooks, plugin wiring, and escalation manager                          |

## Build From Source

For local development from source:

```bash theme={null}
npm install
npm run build
```

## Verify Installation

After installing, confirm the main entrypoints resolve:

```typescript theme={null}
import { parsePolicyYaml } from "sec0-sdk/policy";
import { sec0LocalMiddleware } from "sec0-sdk/middleware";
import { createSec0Guard } from "sec0-sdk/guard";
import { initializeSec0App } from "sec0-sdk/instrumentation";
import { startGatewayServer } from "sec0-sdk/gateway";
```

## Next Steps

* [Quickstart](/docs/quickstart): wire a local integration first
* [Configuration](/docs/instrumentation): register hops and decorators
* [Middleware](/docs/middleware): wrap tool servers
* [Guard API](/docs/guard): gate outbound messages and side effects
