CCAR-F / Free hands-on exercise / Version 1
Can an earlier success complete a new request?
Implement a small guarded tool workflow. Reconcile a delivery timeout for the current operation, then change the scenario so permission is revoked after inspection. An old receipt must never turn the new denied request into a success.
The original lab runs locally with Python 3.10 or newer and its standard library. No package installation, sign-in, account, key or network service is needed after download. Basic Python dictionaries, exceptions and iterators are helpful. Your code, explanations and test results stay on your computer; this page collects no submissions or completion history.
Download the Python starter (ZIP)For a separate exercise with a real local client/server connection, try the MCP discovery companion. It has its own SDK dependency setup.
Start with failing tests
- Check
python3 --version(Windows:py -3 --version). - Extract the starter into a new empty folder. Read
README.md,CONTRACT.mdand the supplied tests. - Run the command below. Four provided validation checks pass; 26 checks intentionally fail because the three implementation methods are unfinished. These counts describe the starter, not a learner score.
python3 -m unittest -v
Windows equivalent: py -3 -m unittest -v. Use a disposable folder separate from customer or production work. There is no setup script.
Implement, change, then investigate
- Original timeout: inspect crate C17 at revision 3, then reserve operation-1. Delivery fails after an in-memory commit. Reconcile that same request without a second effect.
- Changed authority: inspect equipment E92 at revision 8, then remove reserve permission before dispatch. Keep the request incomplete with no new effect.
- Prior success: reuse a service that completed operation-1. A denied or unattempted operation-2 cannot inherit its receipt. Bind completion to the current principal, action, resource, revision and request identity.
- Boundary checks: preserve assistant content and matching tool-result IDs, reject malformed turns, enforce a turn budget, and distinguish failed inspection from successful but unavailable inventory.
Implement Service.dispatch, Service.reconcile and run_loop in workflow.py. Keep the tests unchanged. After implementation run python3 demo.py to inspect actual local transcripts, including a new denied request on a service with an earlier success. Add your own adversarial case. Write a local MY_REVIEW.md identifying the current operation, actual test evidence, matching receipt or unresolved outcome, and limitations. A person still needs to assess your reasoning.
Compare after your attempt
Keep your work. Extract the separate worked solution into another empty folder, execute the same tests and compare its walkthrough with your explanation.
Reveal the worked solution download
The solution checks the current executor policy and reconciles only the matching authoritative in-memory receipt. The walkthrough explains why earlier effects and end_turn are insufficient.
Download the separate worked solution (ZIP)What this local contract establishes
Python executes this finite synthetic application and its supplied adversarial cases. Its response envelope, permissions and receipts are original teaching contracts. Storage is an in-memory dictionary; there is no durable database, concurrent executor or authenticated remote receipt source.
The original version 1 lab does not execute Claude, MCP, an Agent SDK, a provider request or a financial transaction. Passing the finite checks cannot establish correctness for other systems, real idempotency, mastery, transfer effectiveness or exam readiness. These original CertLabs materials are not official exam questions or a full exam simulation.
Follow a real SDK hook decision
In this separate companion, implement a small Python callback and inspect a captured Claude Agent SDK session. Connect each attempted write to its hook decision, tool result and independently checked file state. The capture demonstrates an allowed write and a hook-denied write. A third overwrite attempt never reached the callback: its unchanged file does not prove that the hook enforced revocation.
Your work runs offline with Python 3.10 or newer and its standard library. The supplied capture comes from a separate, version-pinned run; your local callback checks do not launch Claude or reproduce SDK dispatch. No learner API key or package installation is needed. Explain the evidence in your own words using the included human review rubric.
Download the hook companion starter (ZIP)Compare the hook policy after your attempt
The worked solution contains the exact policy used in the supplied capture. These finite examples do not establish general security, race-free revocation, learner mastery or exam readiness. Post-execution and asynchronous-output comparisons use the primary documentation, not additional runtime experiments.
Download the separate hook worked solution (ZIP)Connect a local MCP client and server
This separate companion runs an actual MCP SDK client and a provided server as local stdio processes. Discover tools, resources and prompts; read a synthetic note; retrieve prompt messages; then explicitly call an inspection tool. Listing a tool does not run it, and retrieving a prompt does not call a model.
The recorded exercise demonstrates Python MCP SDK 2.3.0, mcp-types 2.3.0 and protocol 2026-07-28 on Linux x86_64 with CPython 3.12. The dependency lock contains wheel hashes for that environment; other platforms and Python versions have not been demonstrated. Unlike the original standard-library lab, install these dependencies separately. The initial package download needs internet access; the exercise itself uses local stdio with no model, API key or external service.
Download the MCP discovery starter (ZIP)- Extract into a new empty folder and open a terminal there. Read
README.mdandCONTRACT.md. Follow the README to create a Python 3.12 virtual environment and download and install the hash-pinned dependencies. - Run the supplied checker, then complete the five functions in
client.pywithout changing the server or checker. Distinguish resource contents, prompt messages and tool results using the actual returned fields and server audit observations. - Compare the original and changed server cases. The note URI stays the same, but its revision, status and unknowns change. Contrast a stale tool call with a missing-resource protocol error, retaining the actual error status rather than trusting success-looking prose.
.venv/bin/python check_client.py
Keep an evidence note using the included worksheet and human rubric. Finite checks do not assess your written reasoning. The supplied observations concern a synthetic local server; its declarations and structured outputs do not authenticate an identity or establish real-world facts. This exercise does not demonstrate model tool selection, authorization, production integration, complete MCP conformance or exam readiness.
Compare the MCP client after your attempt
Extract the separate worked solution into another folder. Its client uses the same server, dependency lock and checker. Compare the actual discovery, resource, prompt and explicit tool-call observations with your explanation; a passing run is not a calibrated score or evidence of mastery.
Download the separate MCP worked solution (ZIP)Connect decisions to implementation
First compare the two workflow decision scenarios, each with three selected decisions. This separate lab turns selected concepts into local implementation practice; the original version 1 does not add another decision scenario or demonstrate provider integration.
For real provider behavior, consult Anthropic's tool-call handling documentation and its current stop-reason and content schemas. The lab uses its own explicitly finite envelope and does not test conformance to that API.