Who this is for: Developers, enterprise architects, CTOs, platform teams and business owners considering a custom AI agent
How assistants, AI agents and agentic systems differ
| Approach | What it does | Boundary | Example |
|---|---|---|---|
| 1. User and workflow | An event, requester, task identifier and expected output | Document the actor, trigger, finish condition and banned actions | |
| 2. Evidence retrieval | Permission-filtered documents, search or authoritative API records | Record source, version, freshness and access policy | |
| 3. Model and orchestrator | Classify, draft or choose from permitted next steps | Set bounded steps, timeouts, spending and escalation rules | |
| 4. Tool execution | Server-side allowlisted business APIs and validated arguments | Separate read from write and recheck authorization at execution | |
| 5. Human review | Evidence-linked proposed change and named approver | Require approval before claims, payments or production release | |
| 6. Outcome validation | System-of-record reconciliation, traces and test metrics | Check actual outcome, duplicates, retries and corrective action |
Step 1: choose one valuable task and record the baseline
Do not start by selecting a model or building a chatbot. Choose a repeatable business task with a clear request, authorised data, success condition and an identified process owner. For example, prepare a missing-document checklist for a claims reviewer or assemble a manufacturing quality-exception pack. Sample current work, including hard exceptions. Record handling minutes, rework, incorrect routing, escalation and direct costs. These become the comparison baseline; unmeasured automation cannot prove operational value.
Step 2: decide whether the task needs an AI agent at all
A fixed API, SQL query, form validation or deterministic workflow usually offers greater reliability for predictable rules. An AI agent becomes plausible where input varies or an operator must choose between permitted actions using context. Use model output for interpretation and drafts, not as an implicit authorisation service. One narrow agent is simpler to evaluate than an unnecessary multi-agent swarm. Document why a conventional automation alternative is insufficient before accepting ongoing inference and integration costs.
Step 3: define a smallest-safe architecture
A useful reference design is: authenticated trigger → task state → approved retrieval → model decision in constrained schema → tool request validation → optional human approval → authorised execution → state reconciliation → observable result. Keep the model away from raw secrets and administrative credentials. Store workflow state independently of the prompt so a retry does not repeat an irreversible action. Set maximum steps, runtime, tool calls and spend per task, and provide an explicit manual fallback.
Step 4: connect evidence that can be verified
Give the agent approved, source-linked access to an authoritative record store or enterprise search index. Retrieval-augmented generation (RAG) helps locate evidence but does not guarantee correctness. Return stable record IDs, effective dates and versions; filter records by the requester's permissions before retrieval. Test missing pages, OCR corruption, conflicting policy amendments and stale manufacturing drawings. If the correct source cannot be established, the agent should ask for review instead of supplying a confident invented answer.
Step 5: expose a minimal set of tools
List every permitted API and its exact input contract, allowed tenant, rate limits and side effects. Prefer read-only tools in the first pilot. Validate arguments outside the model, including object IDs, destination URLs, file paths, authorization scopes and operation type. Separate draft creation from final submission. Wrap writes in idempotency keys and reconcile whether an external API actually committed an update after a network timeout. A prompt saying 'please ask for approval' is not an enforceable security boundary.
Step 6: choose models and prompts based on tests
A model should be selected for the task's evaluated accuracy, context handling, latency, hosting restrictions and running cost, not only its headline benchmark. Start with a deliberately small prompt that defines the role, evidence use, output schema and escalation conditions. Compare candidate models on the same permissioned evaluation set. Use structured outputs and server-side validation so malformed JSON, unexpected tool names and unsupported claims fail safely. Record the model version used for each test; changing it can alter behaviour.
Step 7: create a real evaluation dataset
Build a permissioned test set representing common cases and hard failures. Include missing records, mixed customer IDs, stale versions, poor scans, near-duplicate filenames, invalid tool arguments and malicious instructions embedded inside retrieved text. For each case, capture the expected evidence, acceptable response, prohibited behaviour and required reviewer step. Measure retrieval correctness, task completion, forbidden action attempts, hallucinated fields, latency, token and tool cost, and human correction time. Compare to existing operations and a deterministic-only baseline.
Step 8: protect against prompt injection and excessive agency
Retrieved emails, websites and PDF content must be treated as untrusted data. Attackers can put apparent instructions inside them. Build hard tool-side restrictions, least-privilege identities, output validation and review gates for sensitive actions. Run explicit adversarial tests: a forged document asks the agent to export client records, a support email includes a new payment destination, or a tool returns a malicious URL. The correct outcome is refusal, safe routing or controlled review. OWASP's Excessive Agency guidance and the NIST AI RMF give useful risk-management references, not a certification guarantee.
Step 9: pilot in stages and monitor the full workflow
First deploy a read-only shadow mode: the agent prepares suggested evidence while the existing process continues. Let trained reviewers mark accepted, corrected and rejected outcomes. Only then consider approval-controlled draft creation or restricted writes. Log trace identifiers, source versions, tool failures, reviewer changes and ultimate system state without exposing confidential data in logs. Build a pause switch and named incident response owner. Escalate when tool responses are incomplete, a confidence threshold fails or permissions change during a task.
Step 10: calculate cost and decide to build or buy
Estimate discovery, system integration, model inference, document processing, security review, evaluation dataset creation, human verification, uptime, logging, support and maintenance. Agent builders can be useful when existing connectors and approval controls match the workload; custom engineering is justified when identity boundaries, audit evidence or multi-system reconciliation require it. An illustrative 'hours saved' estimate is not realised profit. Compare total cost and error consequences with a simpler workflow-engine alternative before approving procurement.
Example: an insurance document agent from request to reviewer
A claims handler asks for a missing-evidence pack for one permitted claim. The system authenticates the handler, loads the correct case ID and policy-effective date, retrieves attachments, extracts fields, checks duplicate or missing files, and drafts a source-linked summary. If a repair quote is absent it requests review instead of guessing its value. No coverage or settlement is decided automatically. The pilot grades version accuracy, reviewer correction time, missing-evidence recall and denied access to unrelated cases. This is an architecture example, not a claim of an existing client rollout.
Example: a manufacturing quality agent with safe QMS handoff
An inspection record has a suspected defect and an ambiguous drawing revision. The agent verifies lot and machine IDs, retrieves the effective specification from permitted ERP/QMS sources, compares inspection observations and prepares an engineer-readable exception summary. A named engineer approves any hold or disposition. If the QMS API fails, retries use a stable transaction ID and a reconciliation check rather than duplicate work orders. The pilot measures false escalation, lot-level traceability, reviewer rework and recovered handling time.
Further reading and references
These sources support general security and risk-management practice. IRAH does not claim certification or endorsement by their publishers.
Make the next discussion specific.
Bring the current workflow, available records and the decision you need to improve. We can discuss an evidence-based assessment and sensible controls before proposing technology.
Discuss this workflow ↗