AI workflows / Practical field guide / November 24, 2026

Why did both prompts change?

You edited one AI prompt variant. The other changed too. Reproduce a shared-state bug in Python before sending either request to a model.

In this field note · 6 sections
  1. Reproduce the shared edit
  2. Inspect what each copy shares
  3. Make it your own
  4. Keep the evidence in scope
  5. Read the primary sources
  6. Get the practice and posting files

Imagine comparing two instructions: “Reply in 3 bullets” and “Reply in 5 bullets.” You build both requests from one template, adjust A and leave B alone. Before comparing any answers, check whether B still contains the original instruction. Otherwise, the experiment you intended to send may differ from the requests you actually built.

What we ran. Five authored Python cases using fictional message dictionaries and nested review tags. Tested locally on Windows CPython 3.13.15 with the standard library. No model, API key, company data or performance benchmark.
Portrait AI Anonymous Field Notes poster on cream textured paper. Large condensed black headline: "WHY DID BOTH PROMPTS CHANGE?" Subtitle: "Separate variants. Shared messages." On a richly detailed oak writing desk, separate wooden document trays marked A and B hold fictional prompt cards. Amber threads from both trays converge on one shared instruction card labeled SYSTEM in a brass clip. A fountain pen touches that card, surrounded by a glass ink bottle, brass fittings, wooden ruler, pencil shaving and leather notebook. Footer: "COPY. CHANGE. CHECK." and "JABSystems.io / AI Anonymous." Original AI-generated conceptual illustration of shared prompt state, not a software screenshot or the lab's exact inputs.
Original AI-generated conceptual artwork. The cards are a metaphor; the downloadable fixture and observed values appear below.

01 / Reproduce

Reproduce the shared edit

Download the practice ZIP and extract it into a fresh folder. It contains check-variants.py, prompt-template.json and a README. With Python 3.10 or newer installed, open PowerShell in that folder. No packages need to be installed.

python --version
python .\check-variants.py
Get-Content -LiteralPath .\lab-output\report.json

The fictional template has a system instruction, a user message about workshop notes, and metadata.review_tags, initially an empty list. In every case the script changes A's instruction to five bullets and appends edited-A to A's tags. It then inspects B and the template. Our observed console output was:

Python 3.13.15 / 5 authored cases passed / no model calls
outer_copy: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=false
message_list_copy: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=false
message_dict_copies: B="Reply in 3 bullets."; B tags=["edited-A"]; template unchanged=false
deepcopy_each: B="Reply in 3 bullets."; B tags=[]; template unchanged=true
deepcopy_batch: B="Reply in 5 bullets."; B tags=["edited-A"]; template unchanged=true
Report: lab-output\report.json

Open the report beside the JSON input. It includes complete A, B and template snapshots for each case, object-identity checks, the input SHA256, Python version and model_called: false. An existing output folder is refused. The JSON input is never overwritten.

02 / Inspect

Inspect what each copy shares

A Python shallow copy creates a new outer container while retaining references to its contents. A copied messages list can therefore still contain the same mutable message dictionaries. Python's copy documentation explains this distinction.

To see the first case directly, save this smaller version as inspect-copy.py in the extracted practice folder, then run python .\inspect-copy.py:

import json
from pathlib import Path

template = json.loads(Path("prompt-template.json").read_bytes())
a, b = template.copy(), template.copy()
a["messages"][0]["content"] = "Reply in 5 bullets."

assert a is not b
assert a["messages"][0] is b["messages"][0]
print(b["messages"][0]["content"])
print(template["messages"][0]["content"])

Both printed instructions say Reply in 5 bullets. The outer dictionaries differ; the inner system dictionary is the same object. Here is checks object identity. The == comparison used elsewhere in the report checks values.

  1. Outer copy: A, B and template share both nested branches. Both edits travel to B and the template.
  2. Messages list copy: the two lists differ, but their system dictionaries are still shared. The instruction edit still travels.
  3. Message dictionary copies: the string-content edit stays in A. The metadata branch was left shared, so B still receives A's tag.
  4. Separate deep copies: both edits stay in A, and the template retains its original values in this fixture.
  5. One deep copy of the batch: the original template stays unchanged, but A and B still share one copied object.

For these simple built-in values, create each independent variant in its own copying call. Save this as isolate-copy.py beside the JSON input and run python .\isolate-copy.py. Its checks complete without printing output:

from copy import deepcopy
import json
from pathlib import Path

template = json.loads(Path("prompt-template.json").read_bytes())
a, b = deepcopy(template), deepcopy(template)
a["messages"][0]["content"] = "Reply in 5 bullets."
a["metadata"]["review_tags"].append("edited-A")

assert b == template
assert b["messages"][0]["content"] == "Reply in 3 bullets."
assert b["metadata"]["review_tags"] == []
assert a["messages"][0] is not b["messages"][0]
The batch trap: a, b = deepcopy([template, template]) is one copying pass over two references to the same object. The copy operation preserves that repeated reference inside the result, so a is b remains true. Copying the whole batch does not create independent variants here.

03 / Make it your own

Change one instruction, then inspect both requests

Try seven bullets with a new output directory:

python .\check-variants.py --bullets 7 --out adapted-output

We ran this adaptation. B changed to seven bullets in outer_copy, message_list_copy and deepcopy_batch. It retained three bullets in the other two cases. Only deepcopy_each kept B's tags empty while also preserving the original template.

For a workflow you own, start with synthetic inputs shaped like your requests. List the fields intended to vary and the nested fields intended to remain fixed. Build the variants, change one, then inspect the final request values immediately before dispatch. Add checks for the fields that matter to your experiment. An application that reconstructs requests from fresh values may use a different approach; verify its output with the same sort of example.

If your message content is itself a list of dictionaries, copying just the message dictionary leaves another nested layer to inspect. Do not assume a copy is independent simply because its printed values initially look right.

04 / Boundaries

Keep the evidence in scope

We exercised all five cases, the seven-bullet adaptation, the exact snippets above, source-byte preservation and the refusal to overwrite an existing report directory. We also reran the exercise from extracted local and public practice ZIPs. These checks concern the Python request objects in this small fictional fixture.

No AI answers, model quality, prompt effectiveness, real batch execution, concurrency or performance were tested. The included script makes no network calls. This result does not establish what a client library does when sending a request or when a service takes its snapshot.

Deep copying has its own limits: custom classes can control it, some resources are not copied, and intentionally shared state may need to remain shared. This example uses only ordinary JSON-shaped dictionaries, lists and strings. Review ownership of clients, files and other resources separately.

Optional AI review prompt, not run: “Inspect this fictional prompt-variant builder. Identify which mutable objects are shared between A, B and the template. Propose checks that show whether editing A changes B. Separate your reasoning from code you actually executed.”

05 / Primary sources

Read the primary sources

Primary sources checked November 24, 2026. Tested with CPython 3.13.15; the maintained 3.13 documentation may show a later patch version. This is a practical use of established Python behavior, not a new release announcement.

06 / Keep it handy

Get the practice and posting files

The practice ZIP contains the script, fictional template and README. The posting ZIP contains the original portrait, teaser caption, alt text and full article URL. Social content is prepared for manual posting; it has not been scheduled or published.

Browse more AI Anonymous field notes or talk with JABSystems about your workflow.

Did this help?

Please don't include personal or confidential information.

Ask or suggest

Please don't include personal or confidential information.

What would you like to send?

Share this post.

Found this useful? Pass it along. Download the artwork, add your own take, and tag @jabsystems.io so I can see your post.