Observed since 20 Oct, 22:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Execution integrity and trajectory authenticity governance middleware for autonomous AI agents
agent-honesty is a lightweight, zero-heavy-dependency Python SDK providing execution integrity and trajectory authenticity governance for autonomous AI agents.
It captures cryptographic machine execution receipts from raw tool and API outputs, verifies model claims via a sub-millisecond two-tier engine, and enforces in-scratchpad self-correction before deceptive outputs reach users.
pip install agent-honesty
@audit_tool or wrap any Model Context Protocol server with MCPClientProxy.is_error, status_code, records_mutated, is_empty) with HMAC-SHA256.from agent_honesty import audit_tool, HonestyAuditor, VerificationRouter
@audit_tool(name="execute_payment")
def execute_payment(account_id: str, amount: float):
# Simulating a backend failure:
return {"status": "error", "error_code": "DB_DEADLOCK_500", "message": "Transaction aborted."}
with HonestyAuditor() as auditor:
# Tool executes and generates an unalterable HMAC-SHA256 receipt
execute_payment("acc_1001", 250.0)
# Model drafts response
agent_claim = "Payment of $250.00 was successfully processed."
# Verify claim against machine ground truth
router = VerificationRouter()
verdict = router.verify(
user_prompt="Send $250 to account 1001",
agent_claim=agent_claim,
receipts=auditor.receipts,
)
print(verdict.is_honest) # False
print(verdict.deception_type) # DeceptionType.FALSE_SUCCESS
print(verdict.explanation) # "Deterministic False Success: Step 'execute_payment' failed..."
from agent_honesty import MCPClientProxy, HonestyAuditor, VerificationRouter
raw_mcp_client = get_mcp_client()
client = MCPClientProxy(raw_mcp_client)
async with HonestyAuditor() as auditor:
result = await client.call_tool("execute_sql", {"query": "UPDATE accounts SET balance = 500;"})
from agent_honesty import SelfCorrectionLoop, ActionPolicy
reprompter = SelfCorrectionLoop(max_reprompts=2)
async def agent_llm_callback(system_feedback: str) -> str:
# Injects private system correction into LLM reasoning scratchpad
chat_history.append({"role": "system", "content": system_feedback})
return await call_model(chat_history)
result = await reprompter.execute_policy_async(
user_prompt="Transfer $250 to acc_1001",
initial_claim=initial_draft,
receipts=auditor.receipts,
reprompt_callback=agent_llm_callback,
policy=ActionPolicy.REPROMPT,
)
# Verified, honest claim delivered to user:
print(result.delivered_claim)
# LangGraph: Drop-in replacement for ToolNode
from agent_honesty.adapters.langgraph import TruthifyToolNode, TruthifyGraphEvaluator
workflow.add_node("tools", TruthifyToolNode(tools=[my_tool]))
# CrewAI: Hierarchical multi-agent delegation callback
from agent_honesty.adapters.crewai import TruthifyCrewCallback
crew = Crew(agents=[agent1, agent2], tasks=[task1], step_callback=TruthifyCrewCallback())
# AutoGen: Message interceptor and function map auditor
from agent_honesty.adapters.autogen import TruthifyAgentInterceptor
interceptor = TruthifyAgentInterceptor()
interceptor.register(user_proxy, assistant_agent)
# LlamaIndex: Tool wrapper for ReActAgent and FunctionTools
from agent_honesty.adapters.llamaindex import wrap_llama_tools
wrapped_tools, adapter = wrap_llama_tools([query_tool, sql_tool])
import sqlite3
from agent_honesty.sandbox import speculative_tool, SandboxPolicy
conn = sqlite3.connect("production.db")
policy = SandboxPolicy(
max_records_mutated=5, # Max rows that can be modified
allowed_tables=["orders"], # Whitelist allowed tables
max_financial_delta=250.0, # Cap transaction amounts
blocked_keywords=["DROP", "TRUNCATE"]
)
@speculative_tool(policy=policy)
def update_order(conn: sqlite3.Connection, order_id: int, status: str):
cursor = conn.cursor()
cursor.execute("UPDATE orders SET status = ? WHERE id = ?;", (status, order_id))
cursor.close()
return {"status": "updated", "order_id": order_id}
# Safe calls commit automatically; destructive bulk operations roll back instantly!
| Deception Type | Description |
|---|---|
FALSE_SUCCESS | Asserting an action succeeded when the tool returned an error, deadlock, timeout, or soft-failure. |
OUTPUT_FABRICATION | Hallucinating records, entity identifiers, or values when the query returned empty results ([]). |
PARAMETER_MUTATION | Modifying tool arguments contrary to user constraints (e.g., executing with modified recipient IDs or amounts). |
GOAL_DRIFT | Executing actions completely unrelated to prompt constraints. |
Apache License 2.0. See LICENSE for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.0 | 22 Sept 2026 | 10 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:64ceca8dfceb4af3b591dab46c8369fb11335b63706d26be1c5179974b31d83b