Designing AI Agents for Multi-Step User Requests

Map request states, data, permissions and handoffs. Evaluate a configured workflow before considering fine-tuning; no training approach guarantees accuracy.

A multi-step request can involve clarification, data retrieval and an action in another system. A language model may help interpret the request, but the application still needs to manage state, permissions, validation and recovery. Most projects should define that workflow before deciding whether to fine-tune a model. Fine-tuning is not a substitute for current business data, explicit rules or evaluation.

Map the task and its states

Describe what the user is trying to accomplish, what information is required, and which conditions change the next step. Represent important fields in a structured format with validation. Keep durable workflow state in the application rather than relying on the model to remember every earlier message. If information is missing or ambiguous, ask a question or send the case to a person instead of guessing.

Separate interpretation from action. The model can classify a request or propose a next step; deterministic application logic should enforce business rules, required fields and allowed transitions. This makes it easier to test what happens with conflicting instructions, incomplete data, retries and corrections.

Choose the simplest method that meets the need

Start with a clear prompt, approved reference material and a small set of examples. Retrieval can provide current policies without placing all of that information in a model’s weights. Use ordinary code for exact calculations, eligibility checks and state transitions. Consider fine-tuning only if evaluation shows a repeatable gap that examples, retrieval and workflow logic do not address, and if the team can manage the training data, versions and retesting.

Do not feed historical chats or support tickets into a training process by default. First review the data’s purpose, permissions, personal information, retention and any model-provider access. Collect only what is needed, and ensure test records do not expose real customer details unnecessarily.

Limit actions and build a human handoff

Give each tool the narrowest access needed for one task. Validate model outputs against a schema, allowlist available functions, and make repeated calls safe where possible. Require explicit human approval before consequential actions such as changing an account, sending an external commitment or issuing a payment. Define a fallback for timeouts, missing records and provider failures.

The OWASP GenAI Security Project’s 2026 LLM risks include prompt injection, sensitive-information disclosure and excessive agency. Use them to inform a threat review; no checklist prevents every failure. The NIST AI Risk Management Framework is voluntary guidance, not a certification or guarantee.

Evaluate before and after launch

Build a test set from representative, approved examples, including ambiguous wording, multiple intents, missing fields, corrections and out-of-scope requests. Measure task completion, wrong actions, escalation rate, review time and end-to-end latency. Inspect errors by type and define thresholds for release, rollback and pause before expanding.

After launch, review samples, overrides and incidents with a responsible owner. Treat user feedback as a signal to investigate, not automatic training data. Update prompts, retrieval sources, rules or model versions through a documented change and retest. This process can provide evidence about one workflow; it does not guarantee accuracy, compliance, efficiency or business return.

Put the idea into practice

Explore Sturox services to discuss a scoped software project.

All articles