{"skills":[{"name":"Verify an agent\u2019s claimed changes from existing records","description":"Check a run\u2019s claimed effects against independent before-and-after records and identify a missing, duplicate or forbidden change without replaying anything.","content":"# Verify an agent\u2019s claimed changes from existing records\n\nCheck a run\u2019s claimed effects against independent before-and-after records and identify a missing, duplicate or forbidden change without replaying anything.\n\n## When to use this skill\n\n- An agent reports that it created a record, sent a message or made a change, and someone needs to confirm it from the system's own records.\n- An evaluation needs to grade an agent run by its outcome in the environment rather than by its transcript.\n- Someone suspects a run sent something it should not have, or created a duplicate.\n\n## When not to use it\n\n- Reproducing the run or testing the agent again, which can cause the very side effects under review.\n- Undoing or repairing a change. Report it first; the system owner decides on any correction.\n- Security incident response, which needs the organisation's incident process and preserved evidence.\n\n## What you need\n\n- A run identifier and a contract naming required and forbidden events, their quantities and observation window.\n- Existing authoritative snapshots, event or audit exports with stable event IDs and correlation information. Include capture scope and any gaps.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What are the run ID, the environment (production, staging or mock) and the time window to check?\n- What were the required and forbidden effects, and in what quantities, such as exactly one draft and no sends?\n- Which records do you have (audit log, event export, database snapshot), and are they complete for the window? If capture stopped early, when?\n\n## Method\n\n1. Turn each claimed or required effect into an observable postcondition: a current state, an event in the window, a new object, or the absence of an event. Read the supplied records only.\n2. Filter events by run correlation, environment and time window. Ignore other runs, mock environments and events outside the window unless asked to include them.\n3. Count distinct event IDs. Repeated lines with the same event ID, such as an export replay or a webhook retry, count once. Distinct IDs count separately; if two distinct events name the same object and event type, mention it as a possible duplicate delivery but keep the count by ID.\n4. Check record completeness. A complete window can prove an exact count or the absence of an event. A partial window can prove that an effect happened or that a ceiling was exceeded, but not that something happened exactly once or never.\n5. An object already in the desired state does not prove this run created it. Check for its creation event under this run's ID.\n6. Give each check a verdict, pass, fail or unknown, with the event IDs it rests on. Keep an unverified claim separate from a disproved one.\n7. Never rerun the command, send a test message or change state to make the evidence agree.\n\n## Checks before you deliver\n\n- A success message from the agent merely records its assertion.\n- A webhook retry can repeat one event ID. Two different created IDs are two effects even when their descriptions match.\n- Counting a mock or sandbox event as a production effect.\n- Treating a partial log that shows no deletes as proof that nothing was deleted.\n- Deduplicating by timestamp. Distinct events can share a timestamp, so track event IDs instead.\n\n## How to present the result\n\nLead with whether the agent's own report is accurate, in one sentence. Then a table of checks: check ID, requirement, verdict, number of distinct events seen and their IDs. List ignored rows (other runs, mock events, out-of-window events) and any gap in the records, and finish with what would settle each 'unknown'.\n\n## Worked example\n\n**Request:** Grade run R8, production, its full observation window. Checks in order: C exactly one create; S exactly zero sends.\n\n**Supplied material:**\n\n```text\nComplete production log for R8 window: E1 R7 create older object. E2 R8 create draft. E2 R8 create draft (export replay). E3 R8 send message. M1 R8 mock send. Agent report: created draft only.\n```\n\n**Answer:** Run R8 created one draft. E2 appears twice in the export but identifies one event. The no-send check failed because production event E3 records a send. The agent\u2019s draft-only report is incorrect.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor each named exact-count check return checks as rows with id, verdict ('pass', 'fail' or 'unknown'), seen (count of distinct matching event IDs) and evidence (the IDs in first-observed order). For incomplete windows pass no exact-count claim; fail if the observed count already exceeds the allowed count. Ignore other run IDs, mock environments and out-of-window rows unless requested.\n\n## Sources\n\n- [Anthropic: demystifying evals for AI agents](https:\/\/www.anthropic.com\/research\/demystifying-evals-for-ai-agents): Distinguishes the transcript of a trial from its outcome, the final state in the environment, gives the example of checking whether a reservation exists in the database, and says it is often better to grade what the agent produced than the path it took.\n- [Stripe documentation: receive events in your webhook endpoint](https:\/\/docs.stripe.com\/webhooks): An example of event-delivery behaviour: endpoints may receive the same event more than once, so processed event IDs should be logged; timestamps should not be used for ordering or deduplication; and occasionally two separate events describe one change, identified by object ID and event type.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/verify-agent-side-effects-from-records\n","scope":"contextual","trigger_keywords":["Verify an agent\u2019s claimed changes from existing records","verify-agent-side-effects-from-records","verify agent side effects from records","Did my agent really make the change it says it made?","Did my agent really make the change it says it made","agent side effects","which actions actually ran","verify the agent's actions"],"is_private":true,"is_active":true,"scripts":[{"name":"verify-agent-side-effects-from-records-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"verify-agent-side-effects-from-records-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: verify-agent-side-effects-from-records\ndescription: \"Check what an agent run actually changed using independent logs, audit exports or before-and-after snapshots, counting distinct events against required and forbidden effects without rerunning anything. Use when an agent says it created, sent, deleted or updated something and someone needs proof.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/verify-agent-side-effects-from-records\n---\n\n# Verify an agent\u2019s claimed changes from existing records\n\nCheck a run\u2019s claimed effects against independent before-and-after records and identify a missing, duplicate or forbidden change without replaying anything.\n\n## When to use this skill\n\n- An agent reports that it created a record, sent a message or made a change, and someone needs to confirm it from the system's own records.\n- An evaluation needs to grade an agent run by its outcome in the environment rather than by its transcript.\n- Someone suspects a run sent something it should not have, or created a duplicate.\n\n## When not to use it\n\n- Reproducing the run or testing the agent again, which can cause the very side effects under review.\n- Undoing or repairing a change. Report it first; the system owner decides on any correction.\n- Security incident response, which needs the organisation's incident process and preserved evidence.\n\n## What you need\n\n- A run identifier and a contract naming required and forbidden events, their quantities and observation window.\n- Existing authoritative snapshots, event or audit exports with stable event IDs and correlation information. Include capture scope and any gaps.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What are the run ID, the environment (production, staging or mock) and the time window to check?\n- What were the required and forbidden effects, and in what quantities, such as exactly one draft and no sends?\n- Which records do you have (audit log, event export, database snapshot), and are they complete for the window? If capture stopped early, when?\n\n## Method\n\n1. Turn each claimed or required effect into an observable postcondition: a current state, an event in the window, a new object, or the absence of an event. Read the supplied records only.\n2. Filter events by run correlation, environment and time window. Ignore other runs, mock environments and events outside the window unless asked to include them.\n3. Count distinct event IDs. Repeated lines with the same event ID, such as an export replay or a webhook retry, count once. Distinct IDs count separately; if two distinct events name the same object and event type, mention it as a possible duplicate delivery but keep the count by ID.\n4. Check record completeness. A complete window can prove an exact count or the absence of an event. A partial window can prove that an effect happened or that a ceiling was exceeded, but not that something happened exactly once or never.\n5. An object already in the desired state does not prove this run created it. Check for its creation event under this run's ID.\n6. Give each check a verdict, pass, fail or unknown, with the event IDs it rests on. Keep an unverified claim separate from a disproved one.\n7. Never rerun the command, send a test message or change state to make the evidence agree.\n\n## Checks before you deliver\n\n- A success message from the agent merely records its assertion.\n- A webhook retry can repeat one event ID. Two different created IDs are two effects even when their descriptions match.\n- Counting a mock or sandbox event as a production effect.\n- Treating a partial log that shows no deletes as proof that nothing was deleted.\n- Deduplicating by timestamp. Distinct events can share a timestamp, so track event IDs instead.\n\n## How to present the result\n\nLead with whether the agent's own report is accurate, in one sentence. Then a table of checks: check ID, requirement, verdict, number of distinct events seen and their IDs. List ignored rows (other runs, mock events, out-of-window events) and any gap in the records, and finish with what would settle each 'unknown'.\n\n## Worked example\n\n**Request:** Grade run R8, production, its full observation window. Checks in order: C exactly one create; S exactly zero sends.\n\n**Supplied material:**\n\n```text\nComplete production log for R8 window: E1 R7 create older object. E2 R8 create draft. E2 R8 create draft (export replay). E3 R8 send message. M1 R8 mock send. Agent report: created draft only.\n```\n\n**Answer:** Run R8 created one draft. E2 appears twice in the export but identifies one event. The no-send check failed because production event E3 records a send. The agent\u2019s draft-only report is incorrect.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor each named exact-count check return checks as rows with id, verdict ('pass', 'fail' or 'unknown'), seen (count of distinct matching event IDs) and evidence (the IDs in first-observed order). For incomplete windows pass no exact-count claim; fail if the observed count already exceeds the allowed count. Ignore other run IDs, mock environments and out-of-window rows unless requested.\n\n## Sources\n\n- [Anthropic: demystifying evals for AI agents](https:\/\/www.anthropic.com\/research\/demystifying-evals-for-ai-agents): Distinguishes the transcript of a trial from its outcome, the final state in the environment, gives the example of checking whether a reservation exists in the database, and says it is often better to grade what the agent produced than the path it took.\n- [Stripe documentation: receive events in your webhook endpoint](https:\/\/docs.stripe.com\/webhooks): An example of event-delivery behaviour: endpoints may receive the same event more than once, so processed event IDs should be logged; timestamps should not be used for ordering or deduplication; and occasionally two separate events describe one change, identified by object ID and event type.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/verify-agent-side-effects-from-records\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/verify-agent-side-effects-from-records\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# A stale object and a repeated delivery\n\nGrade run R8, production, its full observation window. Checks in order: C exactly one create; S exactly zero sends.\n\n## Supplied material\n\nComplete production log for R8 window: E1 R7 create older object. E2 R8 create draft. E2 R8 create draft (export replay). E3 R8 send message. M1 R8 mock send. Agent report: created draft only.\n\n## Worked answer\n\nRun R8 created one draft. E2 appears twice in the export but identifies one event. The no-send check failed because production event E3 records a send. The agent\u2019s draft-only report is incorrect.\n\n## Reasoning\n\nThe replay is one create, while E3 independently contradicts the no-send requirement.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Grade run R8, production, its full observation window. Checks in order: C exactly one create; S exactly zero sends.\nReturn only the JSON specified in SKILL.md for this test.\n\nComplete production log for R8 window: E1 R7 create older object. E2 R8 create draft. E2 R8 create draft (export replay). E3 R8 send message. M1 R8 mock send. Agent report: created draft only.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"checks\": [\n        {\n            \"id\": \"C\",\n            \"verdict\": \"pass\",\n            \"seen\": 1,\n            \"evidence\": [\n                \"E2\"\n            ]\n        },\n        {\n            \"id\": \"S\",\n            \"verdict\": \"fail\",\n            \"seen\": 1,\n            \"evidence\": [\n                \"E3\"\n            ]\n        }\n    ]\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The replay is one create, while E3 independently contradicts the no-send requirement.\n"},{"path":"tests\/case-2\/request.txt","content":"Check run J4 production. C requires one create. D requires zero deletes. F requires one finalise.\nReturn only the JSON specified in SKILL.md for this test.\n\nPartial window only, collector stopped early. A1 J4 create, A2 J4 create, A3 J4 finalise, A4 J3 delete. No further authoritative records.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"checks\": [\n        {\n            \"id\": \"C\",\n            \"verdict\": \"fail\",\n            \"seen\": 2,\n            \"evidence\": [\n                \"A1\",\n                \"A2\"\n            ]\n        },\n        {\n            \"id\": \"D\",\n            \"verdict\": \"unknown\",\n            \"seen\": 0,\n            \"evidence\": []\n        },\n        {\n            \"id\": \"F\",\n            \"verdict\": \"unknown\",\n            \"seen\": 1,\n            \"evidence\": [\n                \"A3\"\n            ]\n        }\n    ]\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The two creates already exceed the ceiling. A later unseen deletion or second finalise remains possible.\n"}],"is_active":true,"is_approved":false}]}]}