Blog · 2026-05-18· 4 min read

The PIV Loop: why agent coding needs Plan, Implement, Validate, not better prompts

PIV stands for Plan, Implement, Validate. Plan is a markdown spec the agent re-anchors to (agent idempotency). Validate is a human review gate BEFORE the loop continues, not CI tests at the end. Archon's May 12 update packaged archon-piv-loop as YAML. Anthropic Agent SDK moves to programmatic credits on June 15, 2026, so a sloppy loop will meter your mistakes. OX Security's CVE-2025-69443 (May 16) on Archon OS makes security gates non-optional, not theatre.

D1D4piv-looparchonagent-idempotency
Painterly walnut three-station workbench. Station 1 (Plan): a parchment markdown spec on a clipboard. Station 2 (Implement): tools and a draft codebase. Station 3 (Validate): an inspector at a brass review gate with a stamp. Loop in apron at the review gate.

Quick answer

PIV is Plan, Implement, Validate. The Plan is a markdown specification (agent idempotency across retries). The Validate step is a human review gate, not a test suite, sitting between Implement and the next iteration. Archon packaged archon-piv-loop as a YAML workflow on May 12. With Anthropic Agent SDK moving to programmatic credits on June 15, 2026, a sloppy loop now meters your mistakes. CVE-2025-69443 (OX Security, May 16) makes security a Validate-step concern, not an after-the-fact ops one.

The myth most teams still operate on

The popular story is that better models will fix AI coding. Bigger context, fewer hallucinations, sharper instruction following. So just wait it out.

That myth exists because ad-hoc prompting looks fast in a demo. Ask for a feature, get code, screenshot the result. Totally logical. Production work does not fail in demo-shaped ways. Production work fails on retry attempt three when the agent forgets attempt one's constraints, on the silent CORS bypass that ships because nobody reviewed before merging, on the wasted iteration that costs $0.10 once and $30 by Friday.

PIV is what structured teams use to escape those failure modes. Below are the four myths it retires.

Four myths PIV retires

Myth 1. "Planning is overhead."

Reality: in PIV, the Plan step is a markdown specification the agent can keep returning to. That is not paperwork. It is agent idempotency: when Implement writes bad code to disk on attempt two, you do not re-prompt from scratch and hope memory holds. You rerun against a written source of truth so attempt three carries attempt one's constraints. The Plan is durable. The prompt was not.

Myth 2. "Validate means tests at the end."

Reality: Archon's May 12 update packaged archon-piv-loop as YAML with a human review gate between Implement and Validate (GitHub release notes). That is a subtle but important shift from CI/CD. CI checks whether code passes. PIV's Validate step checks whether the agent followed intent. A test suite is happy with code that solves the wrong problem. A reviewer is not.

Myth 3. "Workflow packaging is enterprise theatre."

Reality: packaging Plan plus Implement into Archon workflows changes what you optimise for. You stop managing prompts and start managing retries, review gates, and cost. Anthropic's Agent SDK moves to programmatic credits on June 15, 2026 (Infoworld, May 14). After that date, a sloppy loop without iteration caps is no longer just wasted time. It is metered spend that shows up on the monthly invoice.

Myth 4. "Security can wait until the workflow works."

Reality: it cannot. OX Security disclosed CVE-2025-69443 on May 16: unauthenticated API key theft via a CORS bypass in Archon OS. If your agent has filesystem access and secret material, "tests passed" is not validation. It is closure theatre. The Validate gate is the right surface to check for credential exfiltration, unintended writes, and permissive CORS surfaces. Not after the fact.

The nuanced point

PIV is not about making agents feel autonomous. It is about making them reviewable, repeatable, and cheap enough to trust.

That framing sounds less magical than the popular discourse. It also sounds a lot more deployable. The teams shipping agentic workflows in production are mostly the ones who internalised this distinction early. The ones still chasing the next model release are the ones who skipped Plan and Validate.

How this shows up on the exam

D1 (Agentic Architecture, 27%) frequently presents a scenario where an agent produces inconsistent results across runs. The trap answers are "use a more capable model" or "refine the prompt with examples". The architecturally correct answer is almost always one of two PIV moves: introduce a review gate (a hook or human checkpoint between agent output and downstream consumption) or anchor the agent to a written specification (a markdown plan it can re-read on retry). The exam rewards candidates who reach for structure before model selection.

D4 (Prompt Engineering, 20%) tests the prompt-vs-spec distinction directly. Questions about long-running tasks where the agent drifts across iterations are almost always asking whether you understand that a prompt-in-conversation evaporates as the context window rolls, while a markdown plan persists. PIV's Plan step is the named version of that distinction. Memorise the pattern; the exam asks for it in several disguises.

What myth about AI agents still sounds right until you put it in a real workflow?

The honest answer for most teams: "we'll add structure once the prototype proves out". The structure IS what proves it out. Demos with no Plan look good and ship nothing. Workflows with Plan plus Validate look slower in week one and ship more by week six. The two paths diverge fast and they do not re-converge.

01 · Read next in the pillars

Where this lands in the exam-prep map

Each blog post bridges into the evergreen pillars. These are the most relevant follow-ups for this story.

02 · FAQ

7 questions answered

What is the PIV Loop in one paragraph?
Plan, Implement, Validate. The Plan is a markdown specification the agent can re-anchor to across retries. The Implement step writes code (or other artifacts) against that spec. The Validate step is a human review gate, not a test suite, that decides whether the loop continues. The framework was popularised by Archon's May 12 update, which packaged archon-piv-loop as a YAML workflow. It is not new theory; it is the structured version of patterns that high-functioning teams already use ad-hoc.
Why is Plan a markdown spec, not a prompt?
Because agent idempotency matters. When Implement writes bad code to disk on retry attempt two, you do not want to re-prompt from scratch and hope memory holds. You want the agent to re-read a written source of truth so attempt three has the same constraints as attempt one. A markdown spec at the repo root or in /plans is durable and re-readable. A prompt-in-conversation evaporates as the context window rolls.
How is Validate different from CI tests?
CI checks whether code passes; Validate checks whether the agent followed intent. A test suite can be green for code that solves the wrong problem. The review gate sits between Implement and the next Plan iteration. It asks: did the agent address what the spec asked for? If not, the gate sends the work back to Implement with an annotation, not forward to merge. Archon's YAML schema makes this gate explicit; CI/CD makes it implicit and easy to skip.
What does June 15, 2026 change about agent costs?
Anthropic's Agent SDK moves to programmatic credits on June 15, 2026. Today, a runaway loop is wasted wall time. After June 15, every wasted iteration is a metered credit deduction. Sloppy PIV loops without iteration caps and review gates will be visible in your monthly Anthropic statement, not just your patience. The framework's value compounds: structure that was nice-to-have becomes cost-control.
What is CVE-2025-69443?
OX Security disclosed CVE-2025-69443 on May 16: an unauthenticated API key theft via a CORS bypass in Archon OS. It matters here because if your agent has filesystem access and secret material, "tests passed" is not validation. A security-aware Validate step has to include a check that the agent did not exfiltrate credentials, write keys to unintended paths, or open new permissive CORS surfaces. The Validate gate is the place to catch this; CI tests do not see it.
Does PIV apply to non-coding agents?
Yes, with the names of the artifacts adjusted. Plan becomes the structured task specification. Implement becomes whatever the agent does, whether code generation, research summarisation, lead enrichment, or scheduling. Validate stays a human or higher-trust reviewer gate. The loop discipline transfers because the failure mode it addresses, agent drift across retries, is universal across agentic workflows.
How does PIV map to the CCA-F exam?
D1 (Agentic Architecture) frequently has distractors that look like "add more tests" or "use a stronger model". The correct answer for inconsistent agent output is almost always *introduce a review gate* or *anchor the agent to a written spec*. PIV is the named version of both patterns. D4 (Prompt Engineering) tests whether you understand that a written, persisted Plan is different from a prompt-in-conversation. The exam reliably rewards architectural answers that survive retries, not prompts that hope for the best.

Synthesized from research output on 2026-05-18. LinkedIn cross-post pending.
Last reviewed 2026-05-18.

Blog post · D1 · Blog

The PIV Loop: why agent coding needs Plan, Implement, Validate, not better prompts, complete.

You've covered the full ten-section breakdown for this primitive, definition, mechanics, code, false positives, comparison, decision tree, exam patterns, and FAQ. One technical primitive down on the path to CCA-F.

More platforms →