Skip to main content
Rubric gives every agent you ship a cryptographic identity, evaluates every tool call against your policy bundle, and writes a tamper-evident audit log. You drop the SDK into your agent process. Your operators author policies and watch the audit log in the dashboard. SDKs are available for Python and Node.

5-minute quickstart

Install the SDK, enroll your first agent, and watch a denied call land in the dashboard.

How it works

What the SDK does in your process and what it sends over the wire.

Write a policy

YAML in the dashboard, versioned and dry-runnable. Conditions, effects, scope.

Govern Claude Code

npm i -g @rubric-app/claude-code — gate your developer’s own Claude Code install through your policies.

What you get

1

Per-agent signed identity

Every agent gets its own short-lived (60-min) signed token, issued on enrollment and auto-refreshed by the SDK. The agent’s identity is bound cryptographically — events ship with attribution that can’t be spoofed.
2

Runtime policy enforcement

Policies are YAML, versioned, published as bundles, and pulled by the SDK every 30 seconds. Evaluation happens in-process — sub-millisecond, no network round-trip per tool call.
3

Full audit trail with optional traces

Every evaluate() call writes an audit event. Attach a TraceContext and the SDK uploads the full conversation transcript so you can click into any decision and see exactly what the model was thinking.
4

DLP pre-flight

Optional inline DLP scan over tool arguments — regex or Presidio-backed. Detected types become first-class policy fields (dlp_severity eq high → deny).

Three lines of code

import rubric

rubric.init(agent_name="payments-bot")  # once, at process startup

@rubric.tool
def delete_file(path: str) -> str:
    ...                              # raises GovernanceDeniedError if denied
Set AG_ENROLLMENT_TOKEN once, sprinkle @rubric.tool over your tool functions, and every call routes through your policy bundle. No with blocks, no manual evaluate() calls.

Pick your adapter

If you’re using a framework, the adapter wraps your tools so you don’t write any glue code yourself:

MCP

govern_mcp_session(gov, session) — works against any MCP-speaking server.

Claude Agent SDK

governance_hook_matchers(gov) — installs a PreToolUse hook.

LangChain

govern_tools(gov, tools, session_id) — wraps any BaseTool list.

Govern Claude Code

A different shape: Rubric also ships a CLI that gates your developer’s own Claude Code install through the same policies. Same policy authoring, same dashboard, same audit log — different host. Useful when the AI agent you’re worried about isn’t one you wrote.

Claude Code adapter

npm i -g @rubric-app/claude-code && rubric init — installs a loopback daemon that runs every Claude Code tool call through your bundle. Survives reboots via launchd/systemd.