Ingest Agent Run Summary
Emit agent_run_summary.v1 from your agent, POST it to TestNeo, then open
Agent Verification for Claimed → Observed → Verified and
PASS / WARN / BLOCK.
This page covers SDK, REST, MCP, n8n, and the mock refund probe.
Recommended: TestNeo Agent SDK
pip install testneo-agent-sdk export TESTNEO_BASE_URL=https://app.testneo.ai export TESTNEO_API_KEY=tn_YOUR_KEY export TESTNEO_PROJECT_ID=YOUR_PROJECT_ID
Use TestNeo.from_env() and framework adapters
(CrewAIAdapter, LangGraphAdapter, AutoGenAdapter, GenericAdapter).
Full walkthrough with CrewAI example: product quickstart.
from testneo_agent import TestNeo
from testneo_agent.adapters import CrewAIAdapter
sdk = TestNeo.from_env()
with sdk.run(goal="…", source="crewai") as run:
adapter = CrewAIAdapter()
adapter.bind(run)
adapter.from_kickoff(tool_calls=[...], handoffs=[...], final_output=result)
Other paths
| Surface | When | Effort |
|---|---|---|
| Python SDK | Default for CrewAI / LangGraph / custom | ~15 min |
| REST / curl | Smoke / Postman / non-Python | ~5 min |
| MCP | Cursor / VS Code — testneo_ingest_agent_run_summary | ~10 min |
| n8n | Ops / Slack on BLOCK | ~20 min |
| GitHub Actions | CI fail on BLOCK | ~30 min |
Sample scripts (optional): API repo examples/agent-run-ingest-sample/ — Python, Node, and a tiny mock refund API.
Minimum fields for a useful gate
| Field | Why |
|---|---|
agent_run_id, goal, outcome | Identity of the run |
agent_claim | Claimed layer |
actions[] / touched.tools | Observed tools / handoffs |
retrieved[] | RAG evidence (short snippets) |
touched.api | Product HTTP (Lane A) |
gate_contract | expected_facts, expected_retrieval, memory_policy |
Keep payloads thin: tools, short retrieval, memory keys, final claim, API observations, errors. Do not send full prompts, embeddings, or token dumps.
Example body
{
"agent_run_id": "run-2026-07-30-001",
"goal": "Refund order 430 for the authenticated customer",
"outcome": "success",
"agent_claim": "Full refund completed within 30 days per policy.",
"authorization": "READ_WRITE",
"confirmation_obtained": true,
"actions": [
{
"sequence": 1,
"tool": "create_refund",
"operation": "WRITE",
"result": "SUCCESS",
"arguments": { "order_id": 430, "amount": 49.0, "refund_id": 12 },
"result_summary": "refund_id=12"
}
],
"touched": {
"urls": ["https://staging.your-app.example/"],
"tools": ["create_refund"]
}
}
Push the run (REST)
POST {BASE}/api/web/v1/projects/{project_id}/unified-contexts/ingest/agent-run
Authorization: Bearer tn_…
Content-Type: application/json
{ "summary": { … }, "upsert": true, "auto_verify": false }
Save the context_id from the response — you need it for verification.
Run verification
POST {BASE}/api/web/v1/projects/{project_id}/agent-verification/post-agent-gate
Authorization: Bearer tn_…
{
"context_id": 51,
"probe_base_url": "https://staging.your-app.example",
"generate_tests": false
}
Set generate_tests: false for research / content crews. Use API generation only when HTTP was observed (Lane A).
Or skip the API: open Agent Verification in the app, pick the run, set a staging URL if needed, and click Run verification.
Quickstart — see a verified outcome (Lane A)
- Create a project + API key at app.testneo.ai
- Copy
examples/agent-run-ingest-sample/from the TestNeo API repo - Terminal 1:
python3 mock_refund_api.py(listens onhttp://127.0.0.1:8099) - Terminal 2:
export TESTNEO_BASE_URL=https://app.testneo.ai export TESTNEO_API_KEY=tn_… export TESTNEO_PROJECT_ID=15 export PROBE_BASE_URL=http://127.0.0.1:8099 export TESTNEO_RUN_GATE=1 python3 push_agent_run.py
You should see the refund outcome marked VERIFIED.
curl smoke
curl -sS -X POST \ "$TESTNEO_BASE_URL/api/web/v1/projects/$TESTNEO_PROJECT_ID/unified-contexts/ingest/agent-run" \ -H "Authorization: Bearer $TESTNEO_API_KEY" \ -H "Content-Type: application/json" \ -d @agent_run_summary.example.json
Then open Agent Verification and Run verification (set Staging base URL for prove-after-write).
MCP (IDE)
- Configure the TestNeo MCP server with your API key
- Call
testneo_ingest_agent_run_summary - Run the post-agent gate with the returned context id (optional staging URL)
Details: MCP documentation
Checklist
- Prefer SDK for CrewAI / LangGraph / custom agents
- Unique run id per agent run
- Ordered actions / tools (not only the final chat message)
- RAG/memory fields when those matter; ids needed to prove writes (Lane A)
- Confirmation flag correct for destructive tools
- Staging URL when you need prove-after-write
- Secrets never committed
Troubleshooting
| Symptom | Fix |
|---|---|
| 401 | Check API key / Bearer token |
| Writes unverified / WARN | Set staging URL; include ids the check needs |
| Outcome contradicted | App state does not match the claim — fix agent or staging data |
| Policy / retrieval BLOCK | Wrong or missing docs in the run — usually expected |
Product walkthrough — two lanes, UI how-to, FAQ.
Agent Verification →Questions: support@testneo.ai · Updated Aug 2026