Describe the situation, not the rules

Ask @todoist, in French, when the feast starts, in a thread written in English. Until recently it answered “Le festin commence à eight”. The model had translated everything except the time, because one sentence in the base prompt told it to keep quotes as they are written. The answer already ends with a link to the source, which holds the original, so the sentence protected nothing here.

That is how our prompts grew. Each wrong answer got a rule, and 68 of the 76 commits that touched the Comms instructions made them longer. (Comms is Todoist’s team messaging product, where people mention @todoist in threads and chats.) A thread session received 17,400 characters of instructions, and more than half of the sentences were a prohibition or a limit. The model followed some, copied their examples into its answers, and ignored others.

The right altitude

Anthropic’s article on effective context engineering for AI agents describes two ways a system prompt fails. One hardcodes brittle logic to force exact behavior, which breaks as soon as a case falls between the rules. The other stays so high-level that the model gets no concrete signal and is assumed to share context it doesn’t have. The right altitude sits between them: specific enough to guide behavior, flexible enough to leave the model good heuristics. The article also advises against stuffing a prompt with a list of edge cases, and recommends a few canonical examples instead.

Our instructions were at the first altitude. The fix was not to delete rules until the prompt was short, but to give the model the context the rules were standing in for.

What we changed

In agent-core#501 I rewrote the Comms instructions to describe the situation the model answers in. Its text is posted as a message among colleagues’ messages. People read it quickly and act on it. They can’t easily check its work, so they rely on it to carry the facts over unchanged, in their language. The rewrite kept every clause that protects a fact, a link, a mention, a source or a read, and dropped what the tool descriptions already said.

The feast question is one of our evaluation cases, set in a synthetic Hogwarts workspace. The thread and the check, trimmed:

fixture:
    threads:
        - id: th-feast
          content: The feast is on September 1 in the Great Hall, starting at seven.
          comments:
              - id: cm-feast-1
                content: Moved to eight because the Sorting runs long.
question: À quelle heure commence le festin ?
expect:
    must_say:
        - \bhuit\b|\b20 ?h|\b8 ?h
    must_cite_ids:
        - cm-feast-1

The sentence behind “eight” was mine. I added it in agent-core#228, the change that made every answer follow the language of the question. #501 removed it from the base prompt: “Keep names, titles and quotes as they are written.”

The same question now gets “Le festin commence à 20 h”, and the source line still points at the comment that says eight.

“Can you reply to this message?” used to get “I can’t reply to that message.” The evaluation asks it in a staff group chat, about a message wishing the owl post times were pinned on the notice board; the next message says the schedule goes up on Friday. The check wants “Friday” and fails any decline in the first sentence. agent-core#311 fixed the case with the rule below. #501 kept the behaviour in fewer words. Before and after, trimmed:

Before: Replying to a comment or a message of the current thread or chat is
something you can do: answering it here is the reply. […] Don't say you
can't reply, don't say that you replied or posted, and don't offer a draft
instead.

After: Your answer is posted in the conversation. So when the person asks
you to reply to, answer or respond to a comment or message here, they are
asking the question it raises: find it in what you read and answer it, and
that answer is the reply.

The first lists what not to say; the second says where the text goes. The case still passes. Another answer got better while I measured: “read the whole thread” now loads the whole thread instead of looking one fact up.

agent-core#505 did the same for the base prompt, which every run reads, in Comms and on Todoist tasks: what the model knows is what its tools return in this run. Not every rule was fat. The paragraph on dates stayed word for word, because each of its clauses covers a case the model got wrong, such as a plan for “this week” read as confirming today. Two shorter drafts lost a precise clause and the model went back to searching Comms, once for code when GitHub isn’t connected. The examples that tell it where an answer lives stayed.

The same pattern showed up in the notes tools return to the model. When @todoist proposes a change for the asker to confirm, code adds a card below the answer. The tool note said what not to claim (“do not say it is done”), so the model described its own steps instead: “I proposed a comment with the feast details for you to review”, right above the card that said the same. In agent-core#494 I replaced the note with one sentence to write and the words it opens with, chosen to stay true if the change then fails: “The proposed comment posts a one-line notice about the feast in notices.” One evaluation case asks “Post a one-line notice about the feast in comms-thread://th-notices.” The note, before and after:

Before: Proposed, not made: below your answer, the asker sees the exact
change and how to confirm it. Say in one sentence what you proposed; do not
repeat its text, and do not say it is done.

After: Proposed, not made. Below your answer, the asker sees the exact change
and how to confirm it. Write one sentence that introduces it, about it and
not about you: start with "The proposed", in the asker's language, and never
with "I". […] Write nothing else about it: not what you did, not what is
shown below, and not that it is done, because the part below says what
happened.

Code writes the new note from one function, with the opening words as an argument, so every tool whose result code completes below the answer uses the same wording. A first wording, “End your answer with one sentence that introduces it”, brought the narration back in 17 of 20 answers: the model put a sentence about its steps before it.

Finally, agent-core#506, agent-core#508 and agent-core#510 moved every long prompt out of TypeScript template strings into Markdown files beside the code that uses them. A prompt change now reads as a change to a document, for anyone on the team. A check compared every prompt combination before and after: byte for byte the same.

What we measured

Session Before After
Thread 17,400 characters 7,800
Chat 16,100 6,800
Workspace search 14,500 6,400

The base prompt went from 4,600 to 3,750 characters.

The evaluation set kept every check on facts, invented claims, private sources, links, mentions, answer kind and tools. On the final text of #501, with the live model and the judge, every family passed and the judge gave a 5 to 96 of the 103 cases it scored. After #505, all 119 cases passed once each, and the families the restored clauses touch passed 74 of 74 runs.

For #494, the evaluation played each automation and proposed-change case four times. Answers that narrated the model’s own steps went from 20 of 20 to 0 of 20.

Shorter instructions did not make every run smaller. The smallest evaluation run read 4,984 input tokens instead of 7,131. The total over the cases played on both sides did not drop, because a few runs called more tools after a read that failed. The instructions now say to report such a read instead of retrying it; I haven’t measured the total again.

What we stopped measuring matters as much. The evaluation used to check wording: the word “I” in an answer, forbidden openings, emoji in bad news. Those checks were rules too, enforced on the output. I removed them. Voice is now judged by a person reading answer pairs blind, without knowing which side is which.

What I’d tell someone doing the same

Say where the text goes and who reads it. Most of our rules were consequences of that one fact. Once the model knew its answer was a message among colleagues, read quickly and acted on, it got several of them right without being told.

An example becomes the answer. We went through this with declining. In agent-core#175 I made @todoist say “I can’t” at once instead of searching and explaining its tools. That read as curt, so agent-core#177 made the decline kind, with an example: “Unfortunately, it’s not in my abilities to…”. The model copied it almost word for word, and then added workarounds of its own. agent-core#226 went back to plain words. Here is the evaluation’s “Can you reset my password? I’m locked out of my account.” through each version:

Before #175: I couldn't find password reset instructions in this thread and
             the public channels you've joined (…). Name a person, project
             or channel and I'll look again.
#175:        I can't reset your password.
#177:        Unfortunately, it's not in my abilities to reset your password.
             You'll need to reach out to your workspace administrator or use
             the account recovery option.
#226, draft: […] use the **Forgot password?** link on the login screen or
             contact your workspace admin
#226:        I can't reset your password.

Before #175, the answer came after four searches. The draft of #226 allowed one sentence pointing at where to do it, and the model invented a way around in every run of this case, false for accounts that sign in through their company. Nothing in the run says how passwords are reset, so the case now fails an answer that names a login screen, a forgot-password link or an admin. Replayed on that draft’s answers, the check caught 16 of 16. Over 80 evaluation runs of the final text, none gave a reason or a way around. Pick an example that no test case uses: when the password case was the example, that case slowed from 2 seconds to between 16 and 50.

A prohibition pulls against the rest of the prompt. “Don’t search or read” in the decline rule fought the base prompt’s “read before you answer”, and 11 of 33 evaluation runs failed. Saying what the answer needs (“no search or other read”) fixed it. Tell the model what to write.

Shorten, then measure the clauses you lost. In #505, each cut that went too far showed up as a wrong answer in the family it touched. That only works with an evaluation set that checks facts and behavior, not phrasing.

The trade-off is voice. Only the judge’s broad tone score covers it now. Reading pairs blind takes time, and it depends on a person doing it.