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

# Is Warden a Go package?

> Warden is a binary you run, not a library you import — and the reason is the whole product.

Short answer: **no.** Warden is a server. You run it; you do not link it into your agent.

The module is `github.com/Abhishek-Mallick/Warden`, and `go install` works for the commands it contains. But there is no client library to import, and the packages that implement governance are under `internal/`, which Go itself prevents you from importing.

## Why not a library

A library that an agent imports is a library the agent can decline to call.

If governance is a function inside the agent's process, then the agent — or a prompt injected into it, or a bug, or a well-meaning refactor — can call the database driver directly and skip it entirely. The credential is right there in the same process. Nothing about the arrangement can make a guarantee stick.

Warden puts the credential on the other side of a process boundary. The agent has an agent key, which buys it governed access and nothing else:

```
  library:   agent ──▶ governance code ──▶ driver ──▶ database
             (and also: agent ────────────▶ driver ──▶ database)

  gateway:   agent ──▶ gateway ──▶ database
             (no second path exists; the agent has no credential)
```

That is the difference between a policy and a guarantee, and it is why the answer to "can I `import warden`?" is no.

## What is exported

Two small packages are public, for tools that read Warden's output:

| Package | What it holds |
| - | - |
| `pkg/wardenerr` | The error taxonomy: every code Warden can return, its class, whether it is retryable, and the agent-safe message |
| `pkg/ids` | Typed, sortable identifiers (operations, leases, audit events) and their prefixes |

Everything else — the gate, connectors, policy, masking, the IR — is `internal/`. These two are not a client SDK; they help you parse what the HTTP API already gives you.

```go theme={null}
import "github.com/Abhishek-Mallick/Warden/pkg/wardenerr"

if wardenerr.HasCode(err, wardenerr.CodeFenceStale) {
    // The data moved after review. Re-read and propose again.
}
```

## Integrating without a library

Call the [HTTP data plane](https://warden.buildlab.in/api/data-plane.md) — one `POST` and three `GET`s — or use [the MCP server](https://warden.buildlab.in/offerings/mcp-server.md) if your agent speaks MCP. Both are small enough that a client is thirty lines in any language. [Official SDKs](https://warden.buildlab.in/offerings/sdks.md) are planned but not shipped.

## Building on the source

If you want to add a connector or embed the gateway in your own binary, that is a source-level activity rather than a dependency — and the source repository is private, so it needs access:

```bash theme={null}
git clone https://github.com/Abhishek-Mallick/Warden.git
```

The layering rule is enforced in CI (`make importguard`): nothing above the connector layer may import a database driver. A new connector implements the interfaces in `internal/connector` and earns its guarantees by passing [the certification suite](https://warden.buildlab.in/offerings/wardencert.md) — a connector is not done when it runs a query.

> [!WARNING]
>
> Pre-1.0, the internal packages change without notice, and the module carries no API compatibility promise. The stable contracts are the HTTP API, the policy file, the configuration file, and the certification suite.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.