Skip to main content
TL;DR: For a supported framework, secure_agent(agent, agent_id="...", mode="enforce") wraps it with the full trust stack in one call. For anything else, drive TrustRuntime directly: it guards content, checks tool permissions, and attests identity from plain strings and tool names.
The Trust Runtime governs an Agent as an actor. It attests the Agent’s identity, fetches its permitted tools and Guard configuration, checks every tool call against a permission policy before execution, and emits an audit trail. See the concept page for the model; this page shows the code. Install the extras:

Two Entry Points

secure_agent() detects your framework and applies identity, content Guards, tool-permission enforcement, and audit. It supports LangGraph, Google ADK, and Strands.
The keyword arguments are:agent_id (required): the Agent’s identifier, used to fetch constraints and attest identity.mode: "warn" (default) or "enforce".constraints: an explicit constraints dict. When omitted, the runtime fetches them from the Vijil Console.manifest: a signed tool manifest (path or object) for attestation.client: a Vijil client object, used to resolve identity from an API key.See Framework Integrations for per-framework details.

Constraints

Constraints define the Agent’s tool permissions and Guard configuration. The runtime resolves them in this precedence order:
1

Explicit

A constraints dict passed to secure_agent() or TrustRuntime() wins over everything else.
2

Vijil Console

When you pass a client, the runtime fetches constraints from the Console for the given agent_id.
3

Minimal default

With neither, the runtime falls back to a minimal, permissive default (useful for local development).
An explicit constraints dict looks like this:
Organization-level rules (such as denied_tools) apply globally and override an individual Agent’s permissions.

Enforcement Modes

The mode is set once, through the mode argument, and drives every block-versus-log decision.

Manifests and Attestation

A signed tool manifest lists every tool the Agent may call and each tool’s expected SPIFFE identity. Pass one to verify tool identities at startup:
Sign and verify manifests with the vijil manifest CLI (the trust-cli extra):

Audit

The runtime emits a structured audit event for every Guard pass, permission decision, and attestation check. Pass an audit_sink callable to route events to your own logging or telemetry pipeline:

Next Steps

Framework Integrations

Per-framework secure_agent() guides

Trust Runtime Concept

Identity, MAC, manifests, and attestation

Installation

The trust and trust-adapters extras

Observe

Audit events and telemetry
Last modified on July 16, 2026