1. Instrument an existing Claude Agent SDK agent
hooks() lazily builds a default adapter with a generic AgentProfile, the full four-layer evaluator (adversarial, cortical, governance, recovery), and measure-only semantics. It never blocks tool calls unless you pass enforce=True. report() returns a session summary: evaluation count, attestation chain length, whether the chain verifies.
1b. Instrument LangChain / LangGraph, OpenAI Agents, CrewAI, or Google ADK
Same shape, one import per framework. Pick the extra that matches your stack:report() / reset() / adapter() surface as agentegrity.claude, with AgentProfile.default() and the full four-layer evaluator. Pass profile=, client=, or enforce=True to any of the entry points to override.
1c. Export session data to a dashboard or external sink
Every adapter exposesregister_exporter(exporter). Subscribe anything that implements the SessionExporter protocol (on_session_start, on_event, on_session_end) and it receives live session data as JSON-ready dicts:
AGENTEGRITY_EXPORTER_URL and AGENTEGRITY_TOKEN. The default adapter picks them up automatically and streams every session over the published exporter HTTP API.
Non-Python agents use the same contract via one of the six TypeScript adapters, each shipping a 2–3 line zero-config enable. Pick the one that matches your framework:
registerExporter(), report(), and reset() for the same fan-out contract as the Python adapters. The low-level @agentegrity/client reporter is still available for custom frameworks. The wire format is published as JSON Schema in schemas/exporter/ and OpenAPI 3.1 in schemas/openapi.yaml, so any language can produce or consume events.
1d. Instrument a coding agent (Claude Code, Codex)
Coding agents run commands through one generic shell tool, so they are instrumented through their hook systems instead of a library call. Install the library for thepython3 on your PATH, then the plugin for your host:
python3 -m agentegrity hook --host <host>, and one daemon per session keeps the full conversation in view. Piping a download into a shell or wiping logs is denied; sending data out after a secret was read asks on Claude Code and is denied on Codex. Set AGENTEGRITY_HOOK_MODE=alert to record verdicts without enforcing them, and verify a session afterwards:
2. Score an arbitrary agent profile
3. Confidence test from the terminal
doctor prints a composite score and OK, your install is wired correctly.
Next steps
- Custom thresholds, layer weights, and threat detectors: drop down to
IntegrityEvaluatorand the individual layers (see Configuration). - Cryptographic attestation signing:
pip install "agentegrity[crypto]"and callAttestationRecord.sign(private_key)to produce verifiable records. - LLM-backed cortical checks:
pip install "agentegrity[llm]"and passLLMCorticalCheckinstances toCorticalLayer(llm_checks=[...])for semantic reasoning-chain validation. - Governance policies: customize
GovernanceLayer(policy_set=...)or register custom policy rules. See the governance layer spec. - Full specification:
spec/SPECIFICATION.mdis the source of truth for the property definitions, layer contracts, and scoring methodology.

