Skip to main content
Use the AAP and AIP SDKs to add alignment verification and integrity checking directly to your application code. This gives you full control over when traces are generated, how integrity checks run, and what happens on violations. For governance features (policy enforcement, violation reclassification, trust recovery), use the Policy API and Reclassification API alongside the SDKs.
These quickstarts are available in Spanish (Español) and French (Français) — six pages per language have been translated.

Install

1

Define an Alignment Card

An Alignment Card declares your agent’s identity, values, autonomy boundaries, and audit commitments. Every trace and integrity check is verified against this card.
The Alignment Card is the foundation of both protocols. Define it once and use it for AAP verification, AIP integrity checking, and value coherence checks.
2

Generate AP-Traces from agent actions

Every significant decision your agent makes should produce an AP-Trace. The trace records the action taken, alternatives considered, reasoning applied, and whether escalation was evaluated.
Verification matches action.name against bounded_actions, not action.type. Both fields serve different purposes: type is a semantic category; name is the specific operation identifier checked against the card’s bounded_actions list.
3

Verify traces against the card

Verification checks whether the agent’s behavior (recorded in the trace) is consistent with its declared alignment (the card). It returns structural checks, a similarity score, and any violations or warnings.
The similarity_score (0.0 to 1.0) measures how semantically similar the trace’s behavior is to the declared alignment. A trace can pass all structural checks but still receive a low_behavioral_similarity warning if the score falls below 0.50. See calibration for how thresholds were derived.
4

Add integrity checkpoints

AIP integrity checking analyzes LLM thinking blocks per turn to detect prompt injection, value drift, and manipulation. Each check produces a verdict: clear, review_needed, or boundary_violation.
AIP defaults to fail-open mode. If the analysis LLM is unreachable, integrity checks will silently pass. For production deployments handling sensitive operations, set failure_policy: { mode: "fail_closed" } in your AIP configuration.

Verdict to Action Mapping

5

Check value coherence

Before your agent collaborates with another agent, verify their values are compatible. Coherence checking compares declared values and detects conflicts.

Automatic tracing with decorators (Python)

The AAP Python SDK provides decorators for automatic trace generation:

Drift detection

Monitor your agent for behavioral drift over time:

Next steps