DecisionTrace is a simple, powerful tool for creating an audit trail of your AI's decisions. Think of it as a flight data recorder for your AI.
It ensures that every important decision your AI makes is logged in a secure, tamper-evident way, so you can always go back and understand why a decision was made.
- Append-Only Log: Creates a secure, unchangeable log of AI decisions.
- Integrity Chain: Uses a hash chain (like a lightweight blockchain) to prevent tampering and guarantee the chronological order of decisions.
- Replay Capability: Easily "replay" any past decision to see the full context: the prompt, the model used, the output, and more.
- Verification: A simple command to verify the entire log's integrity and detect any corruption or tampering.
First, clone the repository. Then, navigate into the decisiontrace directory and install the tool:
# Install the package in editable mode
pip install -e .This adds the decisiontrace command to your system.
Create a .json file (e.g., my_decision.json) with your AI's decision details:
{
"model": "llama3.2:1b-instruct",
"config": { "temperature": 0.7 },
"prompt": "Should we approve this loan?",
"context_sources": ["policy_v4.pdf", "user_credit_report.json"],
"output": "Approval recommended based on high credit score.",
"confidence": 0.95,
"risk_flags": ["user_pii_involved"]
}Then, log it:
decisiontrace log my_decision.jsonUse the decision_id from the log output to see the full details of a past decision:
decisiontrace replay <your-decision-id>Check the entire history for tampering:
decisiontrace verifyThat's it! You now have a secure, auditable log of your AI's decisions.