
Treating Goal Objectives as Untrusted Context
A deep dive into PR 60342 on the main branch, which treats /goal objectives as untrusted context rather than embedding them directly in continuation instructions.
Chapter 1
Goal objectives become untrusted context
James Turner
If you've been leaving a /goal running overnight, there's a change on the main branch worth knowing about. And before that, thanks to Jellypod AI for sponsoring this episode. Okay, the change. It's PR number 60342, titled "Treat goal objectives as untrusted context." It landed after the 0.167.0 release, so it's on main, not in the stable build yet.
James Turner
Here's what changed. Before, a goal set through /goal could end up embedded directly in the continuation instructions. That means the objective text sat in the part of the prompt the model treats as instruction. Now, per the PR, goal objectives are passed as untrusted goal_objective context instead. They're no longer folded into the continuation instructions. That's the core of it.
James Turner
Why does that matter? Think about how a long thread works. A goal like "reduce p95 latency below 120 milliseconds without regressing tests" lives with the thread across turns. The model can also write or revise objectives as it works. And if the model has been reading a repo, or tool output, or web content, that material can shape what it writes. If that text then gets promoted into instruction level authority, you've got a prompt injection path into the loop that drives every continuation. Treating the objective as untrusted context puts a boundary there. That's my read of the security impact, and the PR frames the mechanism, not a specific attack.
James Turner
Now the mechanics, because there are several pieces. First, if the objective is missing or truncated, the model is directed to call get_goal instead of guessing. Second, a newly created objective is injected into the active turn that created it, without dropping unrelated client context. Third, when the UntrustedAsToolOutput feature flag is enabled, objectives render as tool outputs. The PR's tests check that model-written objectives show up as tool outputs at creation and at continuation, and aren't duplicated in user messages. Fourth, additional context is queued together with the automatic turn input, so both reach the first model request.
James Turner
The deduplication part is easy to overlook. Model-written goals and continuations used to be able to pile up as user-looking messages. Moving them out of that channel keeps your user history cleaner, and that's the session hygiene angle. It also ties back to the earlier episode on thread items list output deferral, where we talked about trimming payloads in thread history. Same theme: keep the thread lean and keep roles honest.
Chapter 2
Using it and what to watch
James Turner
How do you use this? Day to day, nothing changes. You still type /goal followed by an outcome, and you still use /goal pause, resume, and clear. The difference shows up if you build on the SDK or app-server. Expect goal content to arrive as a goal_objective payload, or as a tool output when UntrustedAsToolOutput is on, not as a normal user turn. If you have a client that watches thread items and assumes anything instruction-shaped came from the user, check that assumption.
James Turner
Two caveats. One: custom clients and JSON-RPC consumers should handle the new shape, so test your item parsing against a main build. Two: long goals and compaction. If the objective gets truncated, the model recovers through get_goal. So make sure that tool is actually available in your setup, or the thread can lose direction. And remember, this is main branch, not 0.167.0, so verify before you rely on it.
James Turner
Quick smaller items from main. PR 60391 simplifies Guardian's post denial guidance: if you re-approve after seeing the concrete risk, user authorization is set to high, with the repeated qualifiers removed. PR 60390 lets plain text MCP output be deferred in thread items list, continuing the work from PR 59601. That one pairs nicely with the goal change. PR 60414 makes model catalog discovery work with gateway OAuth credentials. PR 60416 keeps URLs intact in fullscreen Markdown transcripts. And PR 60418 lets the terminal status flip to done even while background terminal processes keep running.
James Turner
Also, this builds on the 0.167.0 theme of command rules needing fresh human approval. Same direction: be explicit about what carries authority. If you ship agent tooling, that's a good lens for your own prompts. That's the update. Go test it on main.