Compare two production prompts
The Week 1 loop keeps a short tool contract for a model: the CONTRACT text in demo.py.
A production coding agent sends much more. It sends a role, working rules, a permission
policy, a stopping rule and a schema for every tool. Two open-source coding agents, Codex CLI
and Qwen Code, publish the code that builds that text under the Apache-2.0 licence. In this
activity you read the same four parts in both, at fixed commits. For every sentence you pick,
you ask the same two questions: what does it make the model do, and what, if anything,
enforces it?
You read the original files on GitHub. This page links them and quotes only a few words, always naming the project. It does not copy the files. Facts about the files come from two reading pages, one for Codex CLI (tools/codex-base-instructions; as_of: 2026-10-09; Source 1; Source 2; Source 3) and one for Qwen Code (tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7). For both agents, these files are not the complete prompt that a release sends at run time. This page does not rank the two products.
Purpose
Optional, about 45 minutes. It earns no marks. It extends the notes' section on reading a production agent's instructions. Parts 1-4 need only a browser. Part 5 is a written plan.
Before you start: your Week 1 run() passes its checks, or you have read its five steps
in the Week 1 notes. You can name
its three tools and its two stop reasons.
AI use: red (no AI). Write your answers yourself. The point is your own reading.
Output: one table for Parts 1-4 and a short Part 5 plan, for your own notes. Nothing is handed in.
The files
| Part | Codex CLI, commit 2351d9e |
Qwen Code, tag v0.25.0 (commit 6788c03) |
|---|---|---|
| 1. Role and instructions | default.md: the opening paragraph and capabilities list, "Task execution", "Validating your work" |
prompts.ts: getDefaultCoreIdentitySentence, "Core Mandates", "Software Engineering Tasks" |
| 2. Tools and schemas | the apply_patch example in "Task execution"; plan_spec.rs for update_plan |
"Using Your Tools" in prompts.ts; edit.ts for edit; todoWrite.ts for todo_write |
| 3. Safety and permission | the approval sentence in the capabilities list; "Validating your work"; the rules that begin NEVER or Do not | "Denied Tool Calls", "Respect Tool Decisions", "Executing actions with care", the sandbox sections |
| 4. Stopping and plans | the first paragraph of "Task execution"; "update_plan" under "Tool Guidelines" |
"Final Reminder"; the todo_write description in todoWrite.ts |
Open both Codex CLI files from the links on its
reading page. They are the base
instructions default.md and the tool definition plan_spec.rs. The Qwen Code files are
linked in the table and on its reading page.
default.md is Markdown, so read it as it stands. prompts.ts is TypeScript that builds
the prompt. Text between backticks is what the model receives. ${...} inserts a value,
often a tool name such as ${ToolNames.EDIT}. The names are listed in
tool-names.ts.
Which sections appear depends on three things: the interaction mode, the sandbox
configuration, and whether the directory is a Git repository. Also, an environment variable
can replace the whole default base prompt with a file. (tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7) Read the interactive default.
Record
Use one row per sentence or rule. Pick at least two per part, one from each agent.
| Part | Agent | Section and a few words | What it makes the model do | What enforces it | Where you saw that |
|---|---|---|---|---|---|
For what enforces it, choose one:
- the schema: a malformed call is rejected before the tool runs;
- the tool's own code: it checks the call and returns an error text to the model;
- a runtime permission or sandbox outside the model;
- nothing visible.
Write "cannot tell" when you did not open the code that would decide. Say which file you would need.
Part 1: role and instructions
- Find the sentence in each file that says what the agent is and what its goal is. Which words could change a choice the agent makes on a dashboard repair, and which only name it?
- Find each agent's rule for checking work after a change. In the Codex CLI file, the approval
mode decides when to run tests and lint. The Qwen Code file asks for the project's own
checks before the agent reports a change complete. It also asks for an honest report when
a check failed or was not run. (tools/codex-base-instructions; as_of: 2026-10-09; Source 1; Source 2; Source 3) (tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7)
For each, describe a run in which the agent reports a change without having run a test.
Which field in your Week 1
completion.jsonwould show that case, and with what value?
Part 2: tools and schemas
- Compare
update_planwithtodo_write: required and optional fields, the allowed status values, and where "one step in progress" is written. IntodoWrite.ts, readvalidateTodos. List what it checks, and say whether it checks that limit. For Codex CLI, can you tell from the files you opened? Mark "cannot tell" where you cannot. - In
edit.ts, read theedittool's description, its parameter schema,validateToolParamValuesandcalculateEdit. Sort each rule into required by the schema, checked by code with an error returned to the model, or only asked in the description. Start from two rules. "At least 3 lines of context" is only asked. A second match withoutreplace_allfails with an error that gives the count. (tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7) What does the model see on its next turn when it breaks each kind? - The Codex CLI file names
apply_patchand shows one call. Did you open its schema? If not, name what you would need to read before you could sort its rules the same way. - Sort your own loop the same way: what does
checkedreject, what doestoolrefuse, and what appears only in theCONTRACTtext ofdemo.py?
Part 3: safety and permission rules
- In the Qwen Code file, "Respect Tool Decisions" says the runtime enforces tool
permissions. "Denied Tool Calls" asks the model not to reach a denied action another
way, such as through a shell, a generated script or an alias. (tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7)
Why might a product need that request as well as the runtime check? For your loop, name
one route that
toolcloses. Then name one route that only the agent's environment closes: the dedicated directory or container described in the safety practices. - The Codex CLI capabilities list refers to a "Sandbox and approvals" section that the file itself does not contain. (tools/codex-base-instructions; as_of: 2026-10-09; Source 1; Source 2; Source 3) What does that tell you about where the rest of the prompt comes from, and what would you need to read next?
- Pick one sentence from "Executing actions with care" or a sandbox section in the Qwen Code file. Describing a sandbox to the model does not create one. Which control outside the prompt would have to exist for the sentence to be true?
Part 4: stopping and plans
- Both files ask the agent to keep going until the request is resolved. The Qwen Code file
also names a way out: the agent reports the specific blocker. (tools/codex-base-instructions; as_of: 2026-10-09; Source 1; Source 2; Source 3)
(tools/qwen-code-system-prompt; as_of: 2026-10-09; Source 1; Source 2; Source 3; Source 4; Source 5; Source 6; Source 7) Neither sentence can stop a loop. Which code stops
your
run(), and what would a production agent need in place of yourstep_limit? - A plan step marked
completedis the model's own claim. Which observation would you need before you accept it? Compare your answer with question G of the session dissection.
Part 5: change one part for your own project
Choose one sentence or schema rule from either file that you would change or add if the agent were working in your own project repository. Examples: name the acceptance command instead of "the project's own test commands", or require a passing check after the last write before any final reply. Write three things:
- The change and where it belongs: the product's base prompt, a repository instruction file (Week 4), a tool schema, or controller code. If a rule can be checked in code, say why you would or would not still put it in the prompt.
- The predicted effect, as something a session record would show: which call appears, the stop reason and the check status.
- The verification: which line of a record, or which check, would show the effect.
Keep this part a written prediction. The scripted proposer in the Week 1 demo.py never
reads CONTRACT. So if you add your sentence there, nothing changes that you can observe in
scripted practice. Write the record you would expect with and without the change. Did a
verify call follow the last write? What were the stop reason and the check? You may later
try the sentence in a real agent session. One run of each version is then one observation,
not a rate, so report it that way. In both cases, also say which part of your loop already
reports the truth regardless of the prompt. last_check stays not_run or check_failed,
whatever the model writes.
Common mistakes
| Mistake | How to notice it | Small correction |
|---|---|---|
| Treating a sentence as a guarantee | Your "what enforces it" column says the prompt | Name a schema, a code check or a runtime control, or write "nothing visible" |
| Guessing about code you did not open | You wrote "enforced" for a rule whose checker you never read | Write "cannot tell" and name the file to read |
Reading prompts.ts as one fixed text |
You quote two sandbox sections as if both were sent | Pick one branch and say which condition selects it |
| Copying long passages into your record | Your table holds whole paragraphs | Give the section and a few words; link the pinned file |
| Judging one product better | Your answer ranks the agents | Compare what each rule does and what enforces it |
All files are plain text on GitHub. You can read them with a screen reader or keyboard. No step needs a diagram or colour.