OpenAI Agents API Sessions Can Change Tools Mid-Run
OpenAI’s Agents API can now update tools in an existing session. Long-running agents need staged permissions, not one giant tool list.
Last week I was looking at a familiar workflow: an agent reads an issue, edits a repository, and eventually prepares a production change. Why should it have all three capabilities from the first turn? The risky part of a long-running agent is often not that the model calls the wrong tool. It is that the model has access to a tool before the workflow has earned that access.
OpenAI’s Agents API changelog records a change on October 30, 2026: tools in an existing session can now be updated. That sounds like a small API feature, but it changes the control plane for long tasks. I used to think of a tool list as a startup setting. I would now treat it as part of the state machine.
Treat tools as stage-specific capabilities
Imagine a session with three stages: inspect an issue, prepare a patch, then create a deployment request after a human approval. Those stages have different failure modes. If read_repo, write_repo, and create_deploy_request are all available at startup, a sentence such as “wait for approval before the final step” is only a behavioural instruction. It is not an access boundary.
I would make the list change with an external workflow event:
tools = [read_issue, read_repo]
session = create_session(tools=tools)
# A review system, not the model, changes the stage.
session.update(tools=[read_issue, read_repo, write_patch])
# Add the deployment request only after a human approval.
session.update(tools=[read_issue, read_repo, write_patch, create_deploy_request])
The exact method names depend on the SDK. The design point is more important: the transition must be driven by an external state change. “Review passed” should be an event from the review system or a recorded human action, not a claim made by the agent in its own transcript.
This maps well to Kubernetes work. Reading a manifest, pushing a branch, and triggering a production rollout should not be one undifferentiated capability. A session can start with read-only inspection, gain repository write access after checks pass, and receive a deployment-request tool only after an explicit approval. The cluster credentials should still live behind a separate service boundary.
Recovery becomes part of the permission model
The moment tools can change during a session, I want answers to three operational questions. Is every update recorded as an auditable event? When a session resumes after a disconnect, does it use the newest tool set or an old snapshot? If an update fails, does the agent pause, retry, or continue with its previous permissions?
I would record the session id, workflow state, old tool hash, new tool hash, actor, and reason for every update. Tool definitions should be versioned too. That gives an operator a way to answer “why could this session call that endpoint?” without guessing which deployment or cache was active.
The user interface needs to follow the same state. If the UI says “ready to deploy” while the current session is intentionally waiting for approval, the system will feel broken even if the security boundary is working. Show the current stage and the capabilities available in that stage. A blocked transition should be a visible workflow state, not an endless stream of model text.
Dynamic tools are not validation
Changing tools reduces the blast radius, but it does not validate arguments. write_patch can still target the wrong directory. create_deploy_request can still carry the wrong environment name. The tool service still needs schema validation, idempotency keys, timeouts, and a dry-run mode. For paid APIs, budget enforcement belongs in that service as well; a prompt is not a billing control.
For me, the useful shift is conceptual. An agent session is becoming a stateful workflow machine with a changing capability set, not a chat window holding a universal key. I would trial this in a non-production repository first and put every capability transition in the normal audit stream. If the logs cannot reconstruct the decision in five minutes during an incident, the agent is not ready for more access.
I would keep the first rollout deliberately boring: one repository, two capability transitions, and no direct production credentials. The Agents API changelog is the source for the session update, while the Agents guide and OpenAI’s practical guide to building agents are useful for checking the surrounding tool model. If a capability change cannot be traced to a workflow event, it should fail closed.
That also keeps ownership visible. The application owns business approval, the tool service owns argument checks, and the platform owns credentials and rate limits. Splitting those responsibilities makes the session update useful without pretending that one API field is a complete security design.
