Free Context/Harness Engineering Course that is getting traction A free, open-source Context Engineering course for AI, released in a 2026 edition, teaches four nested disciplines—prompt, context, harness, and loop—through nine modules, ten auto-graded exercises, and six optional live-model labs, with a dependency-free reference harness and a self-validating test suite of 134 tests. The course, available on GitHub, aims to build robust and reliable AI systems from prompts to autonomous agents. Welcome to the course on Context Engineering for AI. It covers the principles, techniques, and practices for building robust, reliable, and efficient AI systems — from a single well-designed prompt to autonomous agents running unattended. 2026 edition. The field reorganized substantially between 2023 and 2026. This edition follows that reorganization: it teaches four nested disciplines — prompt → context → harness → loop — and ends with a unifying architecture for agentic systems. See CHANGELOG.md /Corneldj/context-engineering/blob/main/CHANGELOG.md for what changed from the previous edition. Nine modules. Modules 1–4 build the foundation; 5–6 make systems that act and that you can trust; 7–8 cover the frontier and the architecture that ties it together; 9 covers making structure explicit — and what happens when systems start rewriting it themselves. The course ships a small, dependency-free reference harness in code/ /Corneldj/context-engineering/blob/main/code — standard library only, no API key, no install. cd code python3 -m unittest discover -s tests -t . 134 tests python3 examples/03 agent loop.py the same model under two harnesses python3 examples/09 meta harness.py a reward hack caught by the gate Ten auto-graded exercises turn the reading into practice — you implement, the tests grade: python3 exercises/check.py grade all ten python3 exercises/check.py ex04 grade one Six optional live-model labs show what the offline mock deliberately hides — real non-determinism, real cache counters, real injection. They need an API key and cost well under $1 in total; without a key they exit cleanly. See code/labs/ /Corneldj/context-engineering/blob/main/code/labs . The course validates itself. Everything above, plus links, task alignment, prose code blocks, and every diagram: python3 tools/validate course.py 9 checks, the same ones CI runs Its test suite is the course's argument in falsifiable form. Each claim has a test that fails if the mechanism is removed — that a loop must not exit on self-report, that tool errors must never raise, that injection cannot amplify absent capability, that a 20-case eval set cannot detect a 10% change, that a graph must refuse an undeclared edge type, that superseding a fact must not destroy history, and that a held-out gate catches an optimizer fitting your evaluator. See code/README.md /Corneldj/context-engineering/blob/main/code/README.md , including its honest limitations. | File | What it's for | |---|---| | CHEATSHEET.md /Corneldj/context-engineering/blob/main/CHEATSHEET.md | Every decision the course asks you to make, on one page. Start here when building | | ANTI PATTERNS.md /Corneldj/context-engineering/blob/main/ANTI PATTERNS.md | Diagnostic reference organized by symptom — what you're seeing, what's causing it, and the fix people try first that doesn't work | | INDEX.md /Corneldj/context-engineering/blob/main/INDEX.md | Concept → lesson → implementation | | templates/ /Corneldj/context-engineering/blob/main/templates | The architecture spec, eval set, red-team cases, tool spec, compaction prompt, and AGENTS.md skeleton | | code/exercises/ /Corneldj/context-engineering/blob/main/code/exercises | Ten auto-graded exercises — implement, then python3 exercises/check.py | | code/labs/ /Corneldj/context-engineering/blob/main/code/labs | Six optional live-model labs API key, < $1 total | | tools/validate course.py /Corneldj/context-engineering/blob/main/tools/validate course.py | The course's own harness: 9 checks, run by CI on every change | | FINAL PROJECT.md /Corneldj/context-engineering/blob/main/FINAL PROJECT.md | Build, measure, and attack a complete agentic system | | GLOSSARY.md /Corneldj/context-engineering/blob/main/GLOSSARY.md | Definitions, including superseded terms marked historical | | REFERENCES.md /Corneldj/context-engineering/blob/main/REFERENCES.md | Primary sources, with a note on which figures to trust | | CHANGELOG.md /Corneldj/context-engineering/blob/main/CHANGELOG.md | What changed in this edition, and why | | SOLUTIONS.md in each module | Worked answers to the hands-on tasks | - Python , read and write. Code examples are Python; the reference harness needs 3.10+. - Comfort with an API client — HTTP requests, JSON, environment variables. - No ML background required. Nothing here involves training a model. - Helpful but not assumed: having built something with an LLM API and watched it behave badly in production. If you have, several lessons will land as recognition rather than instruction. Roughly 35–44 hours including the hands-on tasks. Each module README states its own estimate, its learning outcomes, and a short Check yourself set. Work the modules in order; each builds on the last. Do the hands-on tasks before reading the solutions — many are designed so the intuitive answer is the wrong one, and discovering that yourself is the point. Then do the exercises . The reading tells you a loop must not exit on the model's self-report; ex04 fails until your loop actually refuses a model that claims success without doing the work. That gap is where the learning is. Three paths through it: | If you are… | Read | |---|---| | Building something now | CHEATSHEET.md /Corneldj/context-engineering/blob/main/CHEATSHEET.md → M1 L4 /Corneldj/context-engineering/blob/main/Lessons/Module1/Lesson4 The Four Disciplines.md → M8 L4 /Corneldj/context-engineering/blob/main/Lessons/Module8/Lesson4 Agentic Architecture.md → fill in templates/architecture-spec.md /Corneldj/context-engineering/blob/main/templates/architecture-spec.md → return to the modules your thinnest planes need | | Debugging something broken | ANTI PATTERNS.md /Corneldj/context-engineering/blob/main/ANTI PATTERNS.md , by symptom | | Learning the field properly | Modules 1→8 in order, hands-on tasks included, then the Final Project /Corneldj/context-engineering/blob/main/FINAL PROJECT.md | If you read only two lessons: Module 1, Lesson 4 /Corneldj/context-engineering/blob/main/Lessons/Module1/Lesson4 The Four Disciplines.md is the map, and Module 8, Lesson 4 /Corneldj/context-engineering/blob/main/Lessons/Module8/Lesson4 Agentic Architecture.md is the destination. Techniques churn; frameworks churn faster. These have held across every model generation so far, and they are what the rest of the course implements: 1. Context is finite and degrades. Every technique in Modules 3 and 4 exists because of this. 2. Verification must live outside the agent. A system that grades its own homework will pass. 3. Capability must be scoped. What an agent can do bounds what can go wrong — including what an attacker can make it do. 4. You can't improve what you can't measure. Without evals, every change is a guess with a confident narrator.