Building Production-Grade AI Agents with Guardrails, Context Management, and Security

portia_/riff/_okta · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production-grade enterprise agents

Portia, Riff, and Okta were addressing the gap between agent demos and production systems: agents need guardrails, context discipline, identity and access controls, human approvals, and supportable workflows before they can safely act on production data or customer systems.

Constraints:

Architecture

The panel describes production agent systems built around product/task structure, conditional example retrieval, sandboxed execution, role-based access, shorter curated context, tool-calling retrieval, and human approvals. Portia/Resonant converts documents into well-specified chunks for Linear/Jira/coding agents and uses RAG-style conditional examples to keep generated tasks sane. Riff owns the app-generation environment, guides nontechnical users into task-based development, sandboxes execution, exposes many tools for codebase/package/deployment work, and asks for approval on destructive operations. Okta frames identity, OAuth delegation, and agent permissions as the next security boundary for enterprise adoption.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  user-document-or-chat-request["User document or chat request"] --> resonant-chunking-pipeline["Resonant chunking pipeline"]
  user-document-or-chat-request --> agent-chat-interface["Agent chat interface"]
  resonant-chunking-pipeline --> task-generation-flow["Task generation flow"]
  task-generation-flow --> conditional-example-retrieval["Conditional example retrieval"]
  task-generation-flow --> linear-or-jira-ticket-system["Linear or Jira ticket system"]
  task-generation-flow --> coding-or-app-agent["Coding or app agent"]
  agent-chat-interface --> task-generation-flow
  coding-or-app-agent --> sandboxed-development-environment["Sandboxed development environment"]
  coding-or-app-agent --> tool-catalog["Tool catalog"]
  coding-or-app-agent --> context-search-layer["Context search layer"]
  context-search-layer --> memory-and-learnings-store["Memory and learnings store"]
  offline-context-generation["Offline context generation"] --> memory-and-learnings-store
  offline-context-generation --> context-search-layer
  tool-catalog --> approval-prompt-layer["Approval prompt layer"]
  approval-prompt-layer --> audit-trail["Audit trail"]
  audit-trail --> identity-and-access-controls["Identity and access controls"]
  identity-and-access-controls --> production-systems["Production systems"]
  coding-or-app-agent --> deployment-and-hosting["Deployment and hosting"]
  deployment-and-hosting --> production-systems
  linear-or-jira-ticket-system --> human-review-layer["Human review layer"]
  approval-prompt-layer --> human-review-layer
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User document or chat request Initial natural-language input, PRD, document, or business problem from a PM, nontechnical user, or enterprise operator. Resonant chunking pipeline, Task generation flow, Agent chat interface
Resonant chunking pipeline Transforms normal product or project documents into well-specified chunks for ticketing or coding agents. User document or chat request, Task generation flow, Linear or Jira ticket system
Task generation flow Turns problems into explicit tasks that anchor agent work and reduce context loss. Resonant chunking pipeline, Conditional example retrieval, Coding or app agent, Linear or Jira ticket system
Conditional example retrieval Retrieves relevant example tasks and plans based on the specific agentic application to tune reliability. Task generation flow, Coding or app agent
Linear or Jira ticket system Product-management destination for well-specified chunks and production-like planning data. Resonant chunking pipeline, Coding or app agent, Human review layer
Agent chat interface Open text box where users specify app-building, CRM, payment, or enterprise tasks. User document or chat request, Task generation flow, Approval prompt layer
Coding or app agent Generates apps and agents, including React frontends and Python FastAPI backends, from tasks. Task generation flow, Sandboxed development environment, Tool catalog, Context search layer, Deployment and hosting
Sandboxed development environment Owned runtime and development environment that makes the app-building workflow safer. Coding or app agent, Tool catalog, Deployment and hosting
Tool catalog Package, documentation, codebase, file, deployment, and external-service tools available to the agent. Coding or app agent, Context search layer, Approval prompt layer
Context search layer Lets the agent search for codebase/context on demand instead of loading entire codebases or long documentation into every call. Coding or app agent, Tool catalog, Memory and learnings store
Offline context generation Caches and updates context outside the main request path to meet latency targets. Context search layer, Memory and learnings store
Memory and learnings store Stores refinements, checklists, and learned context from repeated agent runs. Context search layer, Offline context generation
Approval prompt layer Prompts users before payment, deletion, fund transfer, trading, or other risky actions. Agent chat interface, Tool catalog, Audit trail
Audit trail Records who did what, who approved what, and who is responsible for agent actions. Approval prompt layer, Identity and access controls
Identity and access controls Authentication, authorization, RBAC, delegated OAuth, and future agent-permission standards. Approval prompt layer, Audit trail, Production systems
Production systems CRM, databases, APIs, documents, wiki pages, code deployment, files, payments, and other systems agents may read or write. Identity and access controls, Coding or app agent
Deployment and hosting Riff-managed lifecycle from ideation through deploy and hosting for generated apps. Coding or app agent, Sandboxed development environment, Production systems
Human review layer Human responsibility and drafting/review checkpoints before shipping tickets, Jira data, code, payments, or destructive actions. Linear or Jira ticket system, Approval prompt layer

Data flow

A product manager, nontechnical employee, or enterprise user starts with a document, chat request, or problem. Portia/Resonant turns source documents into well-specified task chunks and conditionally feeds relevant example tasks back to the agent as guardrail context. Riff's app-generation agent guides users into a task flow, searches or retrieves codebase context through tools instead of cramming the entire codebase, installs packages, generates React/FastAPI apps, and runs inside an owned/sandboxed development environment. When the agent needs to delete files, pay, transfer funds, write CRM records, or access enterprise resources, approval and authorization boundaries decide whether the action is allowed and who is responsible.

6 supporting quotes
“allows PMs, project managers, engineering managers to turn their normal documents that they use into well specified chunks that can go into linear, Jira, or straight to coding agents.”transcript, stated
“the reason we do that is because a well specified task gives uh effectively the agent guard rates. So it keeps it on track especially is like as models evolve it's less and less of a problem. But it has been quite a big problem and as you go it loses track”transcript, stated
“feed it back in in a kind of like rag based uh you know system such that it always has a list of example tasks”transcript, stated
“We own the development environment. We own everything. And that of course enables us to to sandbox a lot. And so the actual development experience there isn't that bad. But if this is going to have value, then these systems need to be able to read and write”transcript, stated
“is parallel so so these days uh most of the context is uh something the agent asks for like it can search the codebase to find like things pull that into context earlier we needed to somehow cram the entire code base into context on every call. Now [snorts] that is less and so things”transcript, stated
“the user would be prompted right do you want to pay for this? Yes. No, for sure. Like uh we we do that on files even like do you want to delete this file? Right? because uh [clears throat] like the uh there's there's something about like auditability too”transcript, stated

Why this architecture

The architecture structures ambiguous user intent into task artifacts and controlled execution surfaces because production agents are otherwise too easy to confuse. It keeps context precise rather than huge, retrieves examples and codebase facts when needed, sandboxes what the vendor owns, and relies on RBAC, approval prompts, and identity standards when agents touch systems the vendor does not fully control.

5 supporting quotes
“taking these ideas or demos or PCs into production takes a lot of a lot of work because if you think about supportability, you have to think about trust, security”transcript, stated
“as models evolve it's less and less of a problem. But it has been quite a big problem and as you go it loses track right it loses its context. feels like working with someone with Alzheimer, right? And and the task kind of anchors that, keeping it on track and and”transcript, stated
“depending on how big a scope you can tune your systems reliability just based on that context that you feed back in conditionally.”transcript, stated
“that person and then enriches the CRM. that agent gets right access to your CRM right and agents cannot be trusted with like uh just deciding that so so how do you ensure that it can only write to the parts where it can write and so on so those kind of guard rails uh”transcript, stated
“ingest the memory of the system. So it kind of does it automatically. But to the same point we try and keep our context actually quite short and over time I see it as uh super important that because we understand the person the role their place in the codebase”transcript, stated

Models used: AI agent for app generation · Coding agents · LLM tool-calling models

Scale

Alternatives considered (roads not taken)

Let users directly vibe-code from vague ideas

Rejected because: Riff guides nontechnical users into a task flow because well-specified tasks anchor the agent and keep it on track.

“We are about solving problems and problems you have. So we guide uh our nontechnical users into more of a development flow.”transcript, stated
“means like generating tasks and the agent works on tasks and the reason we do that is because a well specified task gives uh effectively the agent guard rates. So it keeps it on track especially is like as models evolve it's less and less of a problem. But it has been quite a big”transcript, stated

Feed broad context without conditional examples

Rejected because: Portia found that conditional example task lists let reliability be tuned to the specific agentic application.

“tasks or whatever and feed it back in in a kind of like rag based uh you know system such that it always has a list of example tasks uh to base it on. And that means depending on how big a scope you can tune your systems reliability just based on that context that you feed”transcript, stated
“conditional list of examples tuned for your specific uh your specific agentic application. >> Amazing. Any anything from you? >> Yeah, we're we're lucky in some form of shape or form. We own the entire development environment, right? So we we we own where it”transcript, stated

Give agents full write access to core systems

Rejected because: The speakers say agents cannot decide their own write scope, especially for CRM enrichment and other production systems.

“that agent gets right access to your CRM right and agents cannot be trusted with like uh just deciding that so so how do you ensure that it can only write to the parts where it can write and so on so those kind of guard rails uh is is something we focus a”transcript, stated
“cannot be trusted with like uh just deciding that so so how do you ensure that it can only write to the parts where it can write and so on so those kind of guard rails uh is is something we focus a lot yeah so so you mentioned uh uh you can't trust agents to write to your systems um but I guess how”transcript, stated

Use maximum-length context windows

Rejected because: Both speakers preferred shorter context for precision, with tool calling and memory/search supplying relevant context on demand.

“much better answer. So I'll ask I'll say one thing. We have never found a way to use uh a very long context window in a good way. We we use uh much smaller than that uh just to have precision. So that's all. to a better precision if it's a smaller >> yeah like the 1 million context window”transcript, stated
“most of the context is uh something the agent asks for like it can search the codebase to find like things pull that into context earlier we needed to somehow cram the entire code base into context on every call. Now [snorts] that is less and so things like”transcript, stated

Upload and trust stale Confluence documentation

Rejected because: Portia worries that human documentation gets stale and can flood the agent; they prefer pushing useful context into code where it is maintained.

“documentation because the same problem that humans have with documentation agents have as well right documentation getsu out of date uh pretty quickly. And so um our customers on the resonant side do ask us, they're like, "Well, we have all this stuff in Confluence. Can we”transcript, stated
“I kind of try to guide people if I can to like push the documentation into the codebase because that's where you're going to see the longevity of it as well is you know you maintain it properly. Agents look at it in every single part of the workflow not just”transcript, stated

Let agents execute risky purchases or deletions autonomously

Rejected because: The speakers describe approval prompts for payment, file deletion, travel booking, trading, and fund-transfer-style operations.

“do you want to delete this file? Right? because uh [clears throat] like the uh there's there's something about like auditability too”transcript, stated
“you don't want them to just book everything. You probably want to review what the agent is doing on your behalf.”transcript, stated

Patterns

guardrails-io-filtering (safety)

The systems use task anchoring, conditional examples, sandboxing, RBAC, approval prompts, and write-scope controls to constrain agent behavior.

“So, so guardrails are very very needed. Yeah. Amazing. Um, so maybe switching to um some customer examples. Uh maybe if both of you can can can um can share like you know what what are your customers using you for?”transcript, stated
“What's appropriate for someone within a a particular role? That's what we you know we were discussing. We were discussing how can you safely allow a UX designer to ship uh code all the way to production?”transcript, stated

rag-retrieval (context)

Portia feeds generated plans/task lists back through a RAG-like conditional-example system to supply relevant task examples.

“And so essentially we came up with this system where you can take your plans your list of tasks or whatever and feed it back in in a kind of like rag based uh you know system such that it always has a list of example tasks uh to base it on.”transcript, stated
“conditional list of examples tuned for your specific uh your specific agentic application.”transcript, stated

tool-use-orchestration (execution)

Riff's app-generation agent uses many tools for codebase search, package install, documentation generation, app building, deployment, and hosting.

3 supporting quotes
“it can search the codebase to find like things pull that into context”transcript, stated
“I think that tool calling has to a large degree replaced some some but but it means that the agent has like 120 tools. >> Yeah.”transcript, stated
“>> now the agent has a tool to generate documentation yes >> so they just generate all the document what about from are are you using any external tools where where uh documentation matters >> uh like uh which packages and so on.”transcript, stated

agent-memory (context)

Agents run refinements, ingest memory, and write learnings/checklists that can be searched later rather than relying on a full-context dump.

“you can essentially run what we refer to as a refinement multiple times and and ingest the memory of the system.”transcript, stated
“to write learnings that agent does like what is learned it's like pushing into a memory”transcript, stated

human-in-the-loop-gate (approval)

Humans remain responsible for shipping, payments, deletions, funds movement, travel bookings, trading, and other risky actions.

3 supporting quotes
“Jira is still an important uh source of um production data right uh so uh we've been very clear that you know you have to have human in the loop in many different ways but it's it's always amazing to me how lazy people are as well because you know we talk to we talk to customers and they're is”transcript, stated
“Um, and and people do accept that, but we deliberately build that in as a like you should review it. You should use it as a drafting UI, uh, etc.”transcript, stated
“responsibility am I now responsible for that agent going and transferring funds somewhere because right so so so for sure we're going to have like an approval process not in our product no but they're probably there probably cases for that like trading bots and so on exists already you know >>”transcript, stated

privacy-preserving-processing (security)

The identity/access-control discussion centers on preventing agents from gaining broad access to databases, APIs, documents, wiki pages, CRM records, and delegated OAuth permissions.

“authentication authorization is a problem today in existing apps and existing architectures”transcript, stated
“if they don't have secure databases or APIs or documents or wiki pages, then you know the risk exposure uh is is pretty significant.”transcript, stated

latency-optimization (performance)

Resonant balances live context gathering with offline cached context to keep end-to-end jobs under a 30-second attention threshold.

“it's a balance between gathering context on the fly and having offline cached context that we keep up to date.”transcript, stated
“Um, and the most important for us is keeping the latency of the job end to end under 30 seconds. 30 seconds is about the maximum where I'll stay at my screen before losing interest essentially.”transcript, stated

context-compaction (context)

The teams keep context short and retrieve/search relevant material rather than filling huge context windows.

“We have never found a way to use uh a very long context window in a good way.”transcript, stated
“But to the same point we try and keep our context actually quite short and over time I see it as uh super important that because we understand the person the role their place in the codebase that the context will be dependent on that but I don't think again we'll use that full million token.”transcript, stated

Tradeoffs

Anchor work in product tasks.

Chose Well-specified tickets, chunks, and task flows over Unstructured idea-to-app conversations.

Rationale: Task artifacts improve agent reliability while also solving a real user pain point around writing tickets/specifications.

“users that you know we did uh user research etc to kind of find out about and also experienced ourselves which is everybody hates writing tickets right nobody loves that right it's the most tedious part of product specification um and the second thing is actually like if you think about vibe”transcript, stated
“agents perform way better if they've got well specified tickets chunks etc”transcript, stated

Use conditional examples as guardrails.

Chose RAG-like retrieval of task examples based on scope over Static prompt instructions alone.

Rationale: Conditional examples keep generated tasks sane while preserving the ability to accept broad prompts.

“Um, which is essentially so you're taking natural language and obviously the problem is is that it generates a task in its list of tasks that's insane, right?”transcript, stated
“plans your list of tasks or whatever and feed it back in in a kind of like rag based uh you know system such that it always has a list of example tasks uh to base it on. And that means depending on how big a scope you can tune your systems reliability just based on that context that you feed back”transcript, stated

Sandbox what the platform owns.

Chose Owned runtime/development environment for app generation over Direct unrestricted production-system access.

Rationale: Owning the environment makes the development workflow safer, but external systems still need explicit access controls.

“We own the development environment. We own everything. And that of course enables us to to sandbox a lot.”transcript, stated
“But if this is going to have value, then these systems need to be able to read and write to core systems, right?”transcript, stated

Keep context shorter and searchable.

Chose Tool-called search, offline context generation, and short curated context over Cramming the whole codebase or using full million-token context.

Rationale: Shorter context preserves precision and latency while tool calling retrieves what the agent needs.

“earlier we needed to somehow cram the entire code base into context on every call.”transcript, stated
“I think that tool calling has to a large degree replaced some some but but it means that the agent has like 120 tools.”transcript, stated

Keep humans in approval loops.

Chose Prompted approvals and drafting/review UI over Autonomous execution of risky actions.

Rationale: The speakers treat payment, file deletion, production data, and generated work as requiring human responsibility even when agents do most of the work.

“people are always taking responsibility for what is getting shipped or put into you know because Jira is still an important uh source of um production data”transcript, stated
“you don't want them to just book everything. You probably want to review what the agent is doing on your behalf.”transcript, stated

Use delegated permissions carefully.

Chose Agent-specific identity/authorization standards and scoped permissions over Simply handing the agent the user's full OAuth permissions.

Rationale: Traditional app boundaries disappear with nondeterministic agents that can query databases, web pages, APIs, documents, and wikis.

“with agents that boundary uh disappears because theoretically agents have the freedom.”transcript, stated
“MCP and spec is getting updated to kind of address those those challenges.”transcript, stated

Gotchas (what bit them)

Productionizing agents requires more than a working demo.

Root cause: Production access introduces supportability, trust, security, and operational constraints absent from POCs.

Resolution: Design for supportability, trust, security, context, and approval boundaries before giving agents production access.

“we've seen lots of cool AI demos. Um, and of course it's easy to to to to build demos and and do PC's”transcript, stated
“supportability, you have to think about trust, security and lots of other considerations.”transcript, stated

Agents lose track without task anchors.

Root cause: Extended conversations and evolving model behavior can erode context and direction.

Resolution: Guide users into well-specified tasks and chunks that anchor the agent's work.

“as you go it loses track right it loses its context. feels like working with someone with Alzheimer”transcript, stated
“And and the task kind of anchors that, keeping it on track and and and and steering it to the right right direction.”transcript, stated

Open chat boxes create unpredictable and unsafe user behavior.

Root cause: Users vary widely in how they instruct AI, including confusing conversations around risky workflows like crypto transfers.

Resolution: Assume arbitrary user behavior and add robust guardrails independent of user sophistication.

“there isn't you cannot assume a behavior it's an open damn text box an open chat”transcript, stated
“there's like tons of ways to confuse an AI agent when when it's like that.”transcript, stated

Agents cannot decide their own write permissions.

Root cause: CRM, databases, APIs, documents, and wiki pages expose sensitive data and side effects that current delegated access models can over-grant.

Resolution: Layer RBAC, authentication/authorization, write-scope limits, and emerging agent-specific OAuth/MCP standards.

“that agent gets right access to your CRM right and agents cannot be trusted with like uh just deciding that”transcript, stated
“the easiest thing to do right now is just give your agents your permissions.”transcript, stated

Documentation can flood or mislead agents.

Root cause: Human-facing documentation goes stale and may be a poor representation of the executable system.

Resolution: Prefer close-to-source context, generated API docs, and documentation pushed into codebases where agents encounter it in workflows.

“minds on documentation because the same problem that humans have with documentation agents have as well right documentation getsu out of date uh pretty quickly. And so um our customers on the resonant side do ask us, they're like, "Well, we have all this stuff in Confluence. Can we can we upload it”transcript, stated
“But for an agent, it's not always the best way. You know, the best the best kind of input to an agent is often to be as close to the as possible.”transcript, stated

Long context can reduce precision.

Root cause: Very long windows are tempting but may dilute relevant signal for agent tasks.

Resolution: Keep context shorter, use tool calling/search, and cache relevant context offline.

“We have never found a way to use uh a very long context window in a good way.”transcript, stated
“to a better precision if it's a smaller >> yeah like the 1 million context window it loses precision >> I I I got to say I completely I completely agree you know I think the question of memory is extremely relevant if you have very long running tasks and processes which like I don't think is the yo”transcript, stated

Responsibility is unclear for agent actions without approvals.

Root cause: Agents can delete files, pay, book, trade, or transfer funds, raising auditability and liability questions.

Resolution: Use approval prompts and audit trails for who did what, who approved what, and what the agent was allowed to do.

“there's something about like auditability too like who did what and who approved what and so on”transcript, stated
“am I now responsible for that agent going and transferring funds somewhere”transcript, stated

Evaluation

The panel does not describe a formal benchmark suite. Evaluation is framed through production-readiness signals: production access, supportability, trust/security posture, user review accuracy expectations, latency under 30 seconds, observed behavior across 150,000 app builders, and whether agents stay on track with well-specified tasks.

Metrics: Production deployment/access rate · End-to-end latency under 30 seconds · Target correctness around 95% for drafting workflows · Number of active builders/users · Need for human approvals on risky actions · Context precision under shorter windows · Whether task anchoring keeps agents on track

5 supporting quotes
“how many of you have your AI agents or apps in production? So accessing production system.”transcript, stated
“Um, and the most important for us is keeping the latency of the job end to end under 30 seconds. 30 seconds is about the maximum where I'll stay at my screen before losing interest essentially.”transcript, stated
“Like I'm going to aim for like 95%, but like this is still a communication tool. You should still be using it. Um, and and people do accept that, but we deliberately build that in as a like you should review it.”transcript, stated
“So, so we've had [clears throat] like 150,000 people this year building apps [snorts] and and you you won't believe how what how people are different in how they chat with AI.”transcript, stated
“And and the task kind of anchors that, keeping it on track and and and and steering it to the right right direction.”transcript, stated

Outcomes

The discussion cites roughly 40% of the audience's AI builders in production, a newly released Resonant product, 150,000 people building apps through Riff, a 30% customer workflow improvement, an agent environment with about 120 tools, a 30-second end-to-end latency target, and a 1 million context window rejected for precision.

5 supporting quotes
“Porsche is an open-source framework for building production grade agents.”transcript, stated
“we have an uh AI agent that generates apps and agents for you like proper um apps in terms of like React front ends, Python fast API backends”transcript, stated
“we've had [clears throat] like 150,000 people this year building apps”transcript, stated
“thing he did something about like they can chat with AI instead and it will generate drawings and and and so on cutting like 30% there and then it went on to the whole production line like Jesus Christ it takes forever to go from like this 3D model CAD thing to like something the CNC machine”transcript, stated
“the severity and scale now has just exploded because of what's possible with with agents”transcript, stated