SDK Direct Integration
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.Install
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.
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.
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.Add integrity checkpoints
AIP integrity checking analyzes LLM thinking blocks in real time to detect prompt injection, value drift, and manipulation. Each check produces a verdict:
clear, review_needed, or boundary_violation.Verdict to action mapping
| Verdict | Proceed | Recommended Action |
|---|---|---|
clear | Yes | continue |
review_needed | Yes | log_and_continue |
boundary_violation | No | pause_for_review or deny_and_escalate |
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
- AAP specification — Full protocol details for implementers
- AIP specification — Integrity protocol details
- Limitations — What AAP can and cannot guarantee
- Security model — Threat model and attack surfaces
- A2A integration — Adding AAP to A2A agent workflows
- MCP migration — Adding alignment tracing to MCP tools