Context Engine: A Pre-Reasoning Pipeline
Too much context makes agents wander on side quests. Too little leaves them spinning in circles. WorkOS’s answer is a context engine — a pipeline that injects task-specific context before the agent calls an LLM. It resolves identity, checks resource access, and injects semantic information about tools. The model receives specific instructions, not a giant menu of tools. The approach shifts from tool-first to context-first.
Identity and Session Scoping
The first layer is identity. WorkOS uses OAuth to understand who the agent works for. Session scoping grants authorization for short durations — usually a few minutes for mutation actions like creating a Linear project. A human must approve the action via a link. The authority expires quickly. If the agent tries again later, the call fails. This design handles long-running, self-reasoning agents while keeping audit trails.
Per-Integration Instructions
Static instructions — how to call Linear, use pagination, format identifiers — are baked into the system prompt to survive compaction. Dynamic context is fetched lazily when the agent invokes a tool. For example, an identity accessing a data warehouse receives join paths in SQL. These free-text instructions are per integration, per identity. They are disposed of after the task to avoid bloating the context window.
Semantic Layer and Disposable Mini-Apps
WorkOS builds a semantic understanding layer across all systems of record. A sales transaction in Snowflake is defined with key metrics and company vernacular. This is served as an MCP resource, so agents share the same language. Internal support and sales teams use an app that generates interactive mini-applications for real-time questions. These apps are disposable — they vanish when the point-in-time task is done.
The mini-apps sit between a dashboard and an internal tool. They can make changes in other systems, be shared, and be mutated. Building them required rich, task-specific context. WorkOS plans to release something around this idea in a few weeks.
Notable Quotes
if context is really important for tool access to be successful, then the question becomes, well, how do I manage this context? Ryan Cooke · ▶ Watch (1:42)
we are injecting per integration instructions into the context window. Ryan Cooke · ▶ Watch (5:55)
And we really couldn’t build a system like this if these agents didn’t have rich, task-specific context that they’re using to generate other applications. Ryan Cooke · ▶ Watch (9:19)
we talk about tools a lot with MCP, but I think what’s interesting is there are these other primitives and you can compose those in really interesting ways specifically around context. Ryan Cooke · ▶ Watch (9:47)
Key Takeaways
- Context-first architecture beats tool-first by providing task-specific context before LLM calls.
- Identity and session scoping with short-lived authorizations keep agents auditable and secure.
- MCP resources enable a shared semantic layer that lets agents coordinate with consistent language.
About the Speaker
Ryan Cooke is a technologist and founder with two decades of experience building early-stage startups. Despite several founding roles, he remains a developer at heart, drawn to hard problems in information retrieval, security and data modeling. He’s led engineering teams across…