Start with application-owned state and review for a predictable workflow. Evaluate LangGraph when a branching workflow must survive a pause or worker restart, and the OpenAI Agents SDK when specific tool calls need approval inside a supervised agent run. Start with a retrieval layer if finding authorized source material is the main challenge. Whichever layer you choose, test rejected decisions, recovery after restart and duplicate delivery before enabling writes.
AI Agent Frameworks for Production: State, Tools and Approvals
Table of Contents
- Choose the framework layer your product needs
- Choose the architecture layer before naming a framework
- Framework selection scorecard
- A compact shortlist: fit, controls, evidence, disqualifier
- Compare human approval and recovery in production
- Worked pilot scorecard: support-ticket triage
- Production controls that belong outside the model prompt
- Disqualifying conditions and common failure modes
- Make the decision with one workflow, not a framework wishlist
- A framework shortlist for a new product
Choose the framework layer your product needs
The first decision is not whether LangGraph, CrewAI, AutoGen, or an SDK is “best.” It is whether the workflow has enough operational complexity to justify an orchestration layer.
Start with one workflow owner and ask:
- How many cases arrive each week?
- What is the current cycle time and review effort?
- What errors are unacceptable?
- Which source systems provide the facts?
- Can the agent only read data, or can it write, send, approve, or change records?
- Who handles exceptions, and how do they restore the previous state?
If those answers are vague, framework selection is premature. A framework cannot supply a baseline, approval authority, source lineage, or recovery process that the business has not defined.
This distinction matters because a framework is an implementation layer, not a business operating model. AWS recommends evaluating agentic AI frameworks in the context of the use case, tools, protocols, and platform design—not as a popularity contest. AWS Prescriptive Guidance is a useful reminder that the surrounding system determines whether a framework creates leverage or just adds abstraction.
Choose the architecture layer before naming a framework
If you’re deciding where the agent will run, compare managed runtimes, hosted builders, and code-first frameworks before ranking SDKs.
Use this scorecard to make the first cut.
| Workflow condition | Better first move | Why |
|---|---|---|
| One bounded decision, one or two tools, deterministic handoff | Direct SDK code or a small custom workflow | Fewer abstractions, clearer tests, simpler ownership |
| Multi-step work with pauses, retries, branching, or durable state | AI agent framework | An orchestration layer can make the control flow explicit |
| Business users need managed connectors, deployment, and visible configuration | AI agent platform | The operating layer may matter more than framework flexibility |
| No owner for permissions, evaluations, or exception handling | Pause the build | The missing operating model is the real risk |
| High-consequence write action or irreversible outcome | Human-approved workflow first | Technical capability does not authorize autonomous action |
A direct workflow can be enough for a simple example: read a form submission, look up an account, draft a response, and queue it for a service representative. If each step is predictable and there is no need to resume a paused process, coordinate several specialist agents, or manage long-running state, a framework may add more surface area than value.
A framework becomes more useful when the workflow must preserve state across steps, recover after a tool failure, route different exception types, and create a record of what happened. Microsoft describes its Agent Framework as supporting individual agents and graph workflows alongside state management, middleware, memory/context providers, and MCP integration. Those are meaningful capabilities only when your workflow actually needs them. See the Microsoft Agent Framework overview for the current scope.
Framework selection scorecard
Before shortlisting any AI agent frameworks, score the workflow on a 0–2 scale. Use 0 for absent, 1 for limited, and 2 for central to the job.
| Decision criterion | Questions to answer | What a high score changes |
|---|---|---|
| Workflow volume | Is there enough recurring work to measure improvement? | Justifies a pilot and ongoing ownership |
| Statefulness | Must work resume after a delay, approval, or failed call? | Favors explicit state and checkpointing |
| Tool reliability | Do source systems fail, rate-limit, or return incomplete data? | Requires retries, timeouts, and fallback handling |
| Source lineage | Must users see which records or documents supported an output? | Requires retained source references and traceability |
| Write permissions | Can the workflow change a CRM, ticket, payment, or policy record? | Reduces autonomy and raises approval requirements |
| Exception rate | Are missing data, ambiguity, or policy edge cases common? | Makes routing and a staffed queue essential |
| Human approver | Is a named role authorized to accept or reject the outcome? | Defines the control point before consequential action |
| Recovery path | Can the action be reversed, corrected, or replayed? | Determines whether automation can proceed safely |
| Ownership | Who owns prompts, access changes, incident response, and evaluations? | Determines whether the system is operable after launch |
| Implementation effort | Can your team support the required integration and observability work? | Favors a design the team can operate and migrate |
A practical rule: do not choose a framework because it scores highly on a feature checklist. Choose it because it makes the highest-scoring workflow constraints easier to inspect, test, and operate.
For example, a document-heavy internal research assistant may score high on source lineage and retrieval quality but low on write permissions and recovery complexity. A data-oriented approach may be enough. A claims or account-change workflow may score high on state, exceptions, approvals, and rollback; it needs a more explicit control model before anyone debates agent “autonomy.”
A compact shortlist: fit, controls, evidence, disqualifier
Choose the operating model first, then test the exact library version and deployment configuration you plan to run.
LangGraph for explicit, stateful workflows
Fit: Consider LangGraph when a workflow has branches, retries, pauses for approval, or a need to resume after interruption.
Required controls: Define the state record, checkpoint ownership, permitted tools, timeout behavior, and the exact point at which a human can approve, amend, or reject an action.
Evidence: LangGraph documents graph-based workflows, persistence, checkpointing, and human-in-the-loop patterns in its overview and persistence documentation.
Disqualifier: Do not begin here for a one-step workflow with a small number of well-defined tool calls. The team may be taking on graph and state-management complexity without receiving meaningful operational benefit.
OpenAI Agents SDK for a narrow, supervised agent flow
Fit: Consider the OpenAI Agents SDK when you want a relatively contained agent flow with tools, handoffs, guardrails, and tracing, especially when an OpenAI-native implementation is acceptable.
Required controls: Set tool-level permissions, validate outputs before any write action, retain traces appropriately, and define what happens when the agent cannot classify or complete a request.
Evidence: The OpenAI Agents SDK documentation describes agents, tools, handoffs, guardrails, sessions, and tracing. Verify the version and deployment constraints you intend to use; documentation features are not a substitute for an acceptance test in your environment.
Disqualifier: Avoid treating a lightweight SDK as permission to skip durable-state design, human approval, or a failure queue when the business workflow requires them.
Multi-agent frameworks and their maintenance requirements
Fit: Use a multi-agent framework only when roles create a useful division of work: for example, one component gathers permitted account context, another drafts, and a reviewer checks defined policy conditions.
Required controls: Test whether the role split improves quality enough to justify extra calls, latency, and troubleshooting. Every agent must have constrained tools, a clear input contract, and a defined escalation path.
Maintenance check: The AutoGen repository was archived on November 20, 2026. Microsoft directs new users to Microsoft Agent Framework and provides a migration path for existing workloads. Check the lifecycle before evaluating a new runtime. AutoGen repository notice
Evidence: CrewAI documentation describes crews, flows, agents, tasks, guardrails, and related concepts. Microsoft AutoGen documentation describes agents, teams, tool use, and human-input patterns.
Disqualifier: Do not introduce “specialist” agents because the design looks sophisticated. If a single deterministic flow can gather facts and draft a result, multi-agent coordination may be unnecessary overhead.
Retrieval-focused tooling for data-centered work
Fit: If the core problem is connecting users to trustworthy internal documents, records, and knowledge sources, prioritize retrieval quality, permission-aware data access, and citation or source display ahead of elaborate agent routing.
Required controls: Define document freshness, access controls, source ranking, missing-source behavior, and how the user sees the evidence behind an answer.
Evidence: Haystack and LlamaIndex agent documentation describe their respective pipeline, data, workflow, and agent capabilities.
Disqualifier: A retrieval layer is not a reason to automate a consequential decision. When a workflow can alter a customer or financial record, retrieval quality is only one of several required controls.
For a direct framework comparison, see AutoGen vs. CrewAI.
Compare human approval and recovery in production
Define what the reviewer is deciding: whether to accept a draft, continue a workflow or execute one specific tool call. Use server-owned review records in every design. A framework pause preserves control flow. The application still verifies the reviewer, the reviewed version and the executor’s current permission before changing an external system.
| Runtime | What pauses and how it resumes | Persistence and rejected decisions |
|---|---|---|
| Application-owned workflow | Commit a pending operation and return control. An authenticated decision queues the next step. This fits review between predictable app steps. | The application stores the proposal, decision and retry state. On rejection it closes the request or creates a new revision for review. |
| LangGraph | A graph node calls interrupt(). Resume with Command(resume=...) on the same thread ID. The node starts again from the top, so keep writes out of the replayed prefix. |
Use a persistent checkpointer for restart recovery. Your graph interprets the returned value and routes rejection away from the write node. LangGraph interrupts |
| OpenAI Agents SDK for Python | Mark a function tool with needs_approval. The runner returns an interruption before executing the call. Apply approve() or reject() to the pending item in RunState and resume with the original top-level agent. |
Persist serialized RunState server-side for long waits. A rejected call is skipped and the resumed run can continue, so check that consequential alternatives also require approval. Agents SDK human-in-the-loop guide |
| CrewAI | Flow @human_feedback requires CrewAI 1.8.0 or later and defaults to console feedback. With the documented async provider pattern, a Flow persists pending feedback and can resume by Flow ID. Enterprise crew task review is a separate webhook and resume flow. |
Verify the async provider and persistence in the version you run. Flow feedback routes to listeners and may be interpreted by a model. Enterprise task rejection can re-run the task and request another review. Gate writes on an authenticated structured decision, even if a listener or task reports approval. Flow feedback, CrewAI task review |
| Microsoft Agent Framework Workflows | In Python, an executor calls ctx.request_info() to emit a request_info event and wait for external input. Resume with workflow.run(responses=...) using responses keyed by request ID. The framework routes each reply to the executor’s @response_handler. Human-in-the-loop workflows |
Use persistent checkpoint storage, such as FileCheckpointStorage on durable disk. Checkpoints include pending requests and responses. After a restart, rebuild the same workflow with stable executor IDs and restore by checkpoint ID. The application must authorize reviewers, enforce expiry, route rejected decisions away from writes, and make writes idempotent. Workflow checkpoints |
| Existing AutoGen AgentChat | UserProxyAgent blocks a live team run while awaiting input. For longer waits, end the run at a defined boundary, persist team state and supply the decision to a later run. |
The live blocked run cannot be saved and resumed at that point. Keep the decision and the write gate in the application, and use the restart test when comparing a migration candidate. AgentChat human-in-the-loop guide |
Use the same harmless operation across candidates, such as adding one label to a sandbox ticket. Pin the runtime and run these tests with a real backing store and a write counter:
- Wait and resume. Stop the worker after the review request is durable. Restart it and approve the same proposal. Verify the proposed arguments survived and the ticket received exactly one label update.
- Reject or expire. Reject one request and let another expire. Confirm zero writes in both cases. If the run drafts a replacement, verify that it requires a fresh decision.
- Retry and revoke. Deliver an approval twice and simulate a lost acknowledgement after a successful write. Confirm one logical update. In a separate run, revoke the executor’s permission after approval and before execution. Confirm zero writes and a recorded denial.
Use the versioned approval and retry example to specify the write gate for this test.
Worked pilot scorecard: support-ticket triage
A useful framework evaluation is a controlled pilot, not a desk-research “experiment.” Here is an illustrative planning model for a support-ticket triage workflow. It does not represent an observed Arsum result.
Normal path
- A new ticket enters the queue.
- The system reads the ticket and retrieves only permitted account details, recent incidents, and approved knowledge-base material.
- It classifies the request and drafts a response with links to the source material used.
- A support lead reviews the draft for the pilot period.
- The approved response is sent through the existing support system.
- The workflow retains the ticket ID, sources consulted, draft version, reviewer decision, tool calls, and final outcome.
Ugly exceptions
- Account status cannot be retrieved.
- The ticket indicates a security, billing, contractual, or outage issue.
- Sources conflict or are stale.
- The model proposes an unsupported commitment.
- A tool call fails or produces incomplete data.
- The system assigns a low-confidence classification.
Each of these should bypass automatic sending and enter a named human queue. The agent should not attempt to “reason through” missing authority.
Illustrative pilot scorecard
| Pilot field | Example planning assumption |
|---|---|
| Scope | One support queue; read-only account and knowledge-base access |
| Baseline | Measure current weekly ticket volume, median first-response time, reviewer minutes per ticket, and rework rate before launch |
| Target | Improve draft availability or reduce reviewer effort without lowering the approved-response standard |
| Quality metric | Percentage of drafts approved without material factual or policy correction |
| Exception metric | Percentage routed correctly to a human review queue |
| Owner | Support operations lead owns acceptance; engineering owner maintains integrations and logs |
| Review cadence | Daily review during the pilot; weekly decision meeting with support, security, and technical owners |
| Write boundary | No autonomous external replies or record changes during the pilot |
| Stop condition | Pause the pilot if unsupported commitments, source-lineage failures, or misrouted high-risk tickets exceed the pre-agreed threshold |
| Rollback | Disable the agent route, restore the existing queue rule, retain logs for review, and revoke tool credentials if needed |
The key point is not a universal target percentage. It is that the team agrees on the baseline, acceptance definition, stop condition, and rollback before the pilot starts.
A scoped workflow assessment should produce these items: a workflow map, system-access boundaries, exception taxonomy, baseline metrics, candidate architecture layer, and a pilot acceptance scorecard. That is a much more useful outcome than a generic recommendation to “use agents.”
Production controls that belong outside the model prompt
A good prompt cannot replace an operating control. Regardless of framework, keep the following boundaries explicit in application logic and governance processes.
Arsum’s illustrative planning framework. Select the diagram to view it at full size.
| Control | Practical implementation question |
|---|---|
| Identity and access | Which service identity runs each tool call, and what is the least privilege needed? |
| Tool permission | Which actions are read-only, draft-only, approval-required, or prohibited? |
| Output validation | What structured fields must be present before an output can move forward? |
| Source lineage | Which records, documents, timestamps, and policy versions are retained? |
| Human approval | Which role can authorize a consequential action, and what evidence do they see? |
| Monitoring | Who reviews tool failures, exception volume, unusual outcomes, and cost changes? |
| Versioning | Can the team identify the prompt, model, tool schema, and policy version used? |
| Recovery | How do you undo an action, requeue a case, or route work back to the manual process? |
The NIST AI Risk Management Framework provides a useful risk-management anchor, while the OWASP GenAI Security Project highlights risks such as prompt injection and insecure output handling. These sources do not certify any specific framework. They help teams ask the right control questions before putting an agent near sensitive data or write actions.
High failure cost and low reversibility should reduce autonomy. A framework’s ability to call a tool does not mean it should be allowed to execute the action without review.
Disqualifying conditions and common failure modes
Do not launch a framework-led agent workflow yet if any of these are true:
- No one can name the business owner, technical owner, and exception owner.
- The source systems do not provide reliable, permissioned inputs.
- The workflow has no measurable baseline or decision criterion.
- A mistaken action cannot be reversed or reviewed.
- The team cannot retain the evidence needed to explain an output.
- The use case depends on publishing large volumes of low-value generated content.
- The organization is trying to solve unclear process design with more agent autonomy.
Common failure modes are usually operational:
- Selecting a framework before mapping the exception path.
- Giving an agent broad write permissions to compensate for weak integration design.
- Measuring demo completion instead of reviewed business outcomes.
- Adding multiple agents before proving that a single flow cannot perform the work.
- Treating traces as sufficient when the organization still lacks a person who owns incidents.
- Building custom infrastructure when a platform or narrower automation would meet the real need.
Make the decision with one workflow, not a framework wishlist
Choose direct code when the job is narrow, predictable, and easy to test. Choose a framework when the workflow genuinely needs durable state, branching, tool orchestration, and reviewable recovery. Choose a platform when managed runtime and business-user operations outweigh architectural freedom.
Then run a bounded pilot with:
- one workflow;
- a measured baseline;
- restricted system access;
- a named human approver;
- retained evidence;
- a review cadence;
- a stop condition; and
- a rollback path.
That is the practical standard for comparing AI agent frameworks. The winning option is the one your team can operate safely after the prototype is no longer interesting.
A framework shortlist for a new product
Choose the layers independently. Orchestration manages steps and state, retrieval finds source material, and evaluation and tracing help inspect behavior. A single application may need several layers with explicit interfaces.
For retrieval-heavy products, compare LangChain, LangGraph and LlamaIndex using the same questions, permissions and source corpus. For multi-agent work or a migration, assess the differences between AutoGen and CrewAI.
Record the simplest viable design, why it needs an agent, which library boundaries remain replaceable, the cost per accepted action and the incident owner. Use the architecture patterns to choose who owns state and the final answer. Pick a representative case from the worked agent examples and attach the results of its recovery and approval tests to the decision record.
Published by:Arsum
- Published
- February 5, 2026
- Updated
- December 5, 2026
- How this was produced
- These guides are prepared and updated with AI assistance. Linked documentation, proposed evaluation methods, and illustrative calculations are distinguished from reported project results. No independent human review is implied by the byline.
- Source policy
- Technical references are linked where used. Planning figures and suggested scorecards are assumptions, not market benchmarks or measured client outcomes. Editorial policy.
- Why this page exists
- Help engineers choose and test a production agent runtime against state, tool and approval requirements.