How agents are built and run
Primitives, the supervisor → sub-agent pattern, tools and MCP policies, approvals, the run lifecycle, the agent library and the SDLC agent team.
Updated: September 2026Primitives
In the visual agent builder every agent is composed from eight primitives. The Autonomous Agent uses the same primitives; an agent produced by dialogue runs and is observed exactly like one designed by hand.
| Primitive | Role | Typical use |
|---|---|---|
| Agent | A specialist with its own model, tools and memory | Credit agent, claims agent, invoice agent |
| Supervisor | Breaks the objective into steps, delegates, merges the result | Entry point of every multi-agent scenario |
| Router | Branches the process by intent, rule or score | Intent classification, path choice by risk score |
| Memory | Shares session and long-term context across agents | Customer context, earlier turns |
| Guardrail | Checks input and output against policy; blocks or masks | PII masking, unauthorised requests, prompt injection |
| Human approval | Pauses on critical decisions, presents to the approver, records the decision | Above-threshold amounts, policy exceptions |
| Tool / MCP | Read or write to an enterprise system; policy per tool | Core, CRM, ERP, ticketing calls |
| Parallel & loop | Runs independent steps simultaneously and repeated work until a condition is met | Multi-source lookups, batch document processing |
The supervisor → sub-agent → supervisor pattern
This is the core execution pattern of Aginies. The supervisor plans and merges results; specialist agents take narrow, well-defined tasks. Control returns to the supervisor after every step, so one sub-agent’s failure does not break the whole process.
- The supervisor receives the request and decomposes the objective into structured steps.
- It delegates each step to the right specialist; independent steps run in parallel.
- The sub-agent works with its own model and tools and returns the result with its rationale.
- The supervisor verifies, merges and decides the next step.
- Where approval is required the process pauses; the decision is recorded, then it resumes.
- On completion the outcome goes to the channel; the full trace is written to the audit log.
Execution is stateful: steps, intermediate results and tool responses are kept. When a dependency fails the supervisor retries, switches to the fallback model or escalates to a person; the process resumes where it stopped.
Tools and MCP policies
Agents reach enterprise systems through tools: REST APIs, databases and Model Context Protocol (MCP) servers. Every tool is classified as read or write and carries its own invocation policy. The MCP Hub catalogues approved servers only.
- Read / write class: write tools are bound to an approval or threshold rule by default
- Per-tool invocation policy: allowed parameters, rate limit, which agents may call it
- Input and output masking: sensitive data to and from the tool is redacted
- Every call appears in the trace: parameters, duration, response code and result
- MCP Hub: approved servers, versions and access rights under central management
- Agent-to-agent communication (A2A) works under the same policy framework
Approvals and thresholds
Human approval is a primitive of the agent definition. On a critical decision the process pauses, the decision is presented to the approver with context and rationale, and the outcome is written to the audit trail. Thresholds and approvers are set in the agent definition.
- Amount threshold: transactions above a value go to the approver
- Risk threshold: a score or guardrail signal triggers approval
- Policy exception: out-of-policy requests always reach a person
- Irreversible actions: mandatory approval for deletion, payment and contract changes
- Approver role: defined roles such as branch manager, compliance team, release manager
- Kill-switch: immediate stop and automation limit per agent or scenario
Run lifecycle
Every run is made of nine step kinds. Each agent page in the library shows its steps with these kinds; the duration, token usage and touched system of every step are recorded in the trace.
- Ingest: the signal arrives; voice, email, API, message or event
- Plan: the supervisor decomposes and routes
- Retrieve: lookup in the knowledge base or database (RAG)
- Reason: classification, extraction, scoring
- Tool: a read call to an enterprise system or an MCP tool
- Verify: guardrail, policy and consistency checks
- Approval: the human-in-the-loop checkpoint
- Write: a state-changing action in an enterprise system
- Notify: customer or staff communication
A run starts with an ingest step and ends with a write or notify step. End-to-end latency is derived from the step durations; cost per run is computed from the token usage of model calls and attributed by scenario, unit and channel.
The agent library
The library holds 77 agents across 14 sectors. Each is a simulation derived from real agent definitions: supervisor, specialist agents, systems, steps and approval rule are all defined. Every one can be produced with the Autonomous Agent and adapted to the enterprise’s systems.
How to read an agent page:
- Title and tagline: the agent’s purpose and outcome-oriented summary
- Trigger and outcome: what starts the run and what is true when it finishes
- Channels: voice, email, app, API, WhatsApp, web or batch
- Supervisor and agents: each agent’s role, model and tools
- Systems: the core, CRM, ERP, ticketing, payments and other systems touched
- Steps: in execution order with kind, target system, duration and tokens
- Approval rule: the threshold and approver of the human checkpoint, where present
- Metrics: monthly runs, success rate, median duration, cost per run
- Inspired by: the proven global pattern the agent mirrors
The full list of the library; every row is a scenario page.
| Scenario | Sector | Channels | Agents | Systems | Approval rule |
|---|---|---|---|---|---|
| Dialogue banking: voice and text transaction assistant | Banking | app, voice, whatsapp | 4 | 5 | Limit increase > 60%, dispute amount > 5,000 or transfer to a new payee → operations approval |
| Merchant operations assistant: POS, settlement, refund and limit | Fintech & Payments | whatsapp, web, voice | 4 | 5 | Refund > 25,000 or limit increase > 50% → risk team approval |
| End-to-end motor claim: from notice to payment | Insurance | voice, app | 4 | 5 | Estimate > 150,000, unclear fault share or overlap with prior damage → adjuster approval |
| Outfit stylist: a complete look by size, stock, budget and style | Retail & E-commerce | app, web, whatsapp | 4 | 5 | Discount outside campaign rules or a bespoke price request → customer service |
| Subscriber care assistant: bill, plan, fault and contract | Telecom | voice, app, whatsapp | 4 | 5 | Contract cancellation, bill correction above 500 or technician priority → representative approval |
| Legacy module modernisation: analysis, tests, rewrite, PR | Software Delivery | api, batch | 4 | 4 | Production schema change or out-of-scope file → architect approval; PR merge always human |
| Patient journey coordinator: appointment, preparation, approval and results | Healthcare | whatsapp, voice, app | 4 | 5 | Drug interaction, suspected contraindication or extra test need → physician approval |
| Line stoppage response: from alarm to work order and shift report | Manufacturing & Automotive | api, app | 4 | 5 | Schedule change > 2 hours or urgent purchase above 50,000 → shift lead approval |
| Control tower: delay prediction, rerouting, customer notice, SLA | Logistics | api, email, whatsapp | 4 | 5 | Route cost increase > 15% or compensation > 10,000 → operations manager approval |
| Utility customer assistant: bill, outage, consumption and instalments in one dialogue | Energy & Utilities | voice, whatsapp, app | 4 | 5 | Instalments > 6 months, bill cancellation or meter suspicion → customer service approval |
| Citizen services assistant: application, documents, appointment and status | Government & Public Sector | whatsapp, voice, web | 4 | 5 | Borderline eligibility, inconsistent document or another application in the household → officer review |
| Procure-to-pay desk: request, quotes, contract and invoice in one place | Enterprise Functions | email, api | 4 | 5 | Amount > 250,000, single quote or non-framework supplier → procurement committee |
| Technical publication assistant: maintenance manual, parts, procedure and revision control | Defence & Aerospace | app | 4 | 5 | Proposed deviation from the procedure → authorised engineer approval; export-controlled content → clearance required |
| Field device support assistant: telemetry, remote diagnosis, OTA and technician | IoT & Connected Devices | whatsapp, web, api | 4 | 5 | Bulk OTA (>100 devices) or out-of-warranty device replacement → product-owner approval |
| Credit card limit increase | Banking | app, voice | 3 | 3 | Limit > 100,000 → branch manager approval |
| Digital account opening (KYC) | Banking | app, web | 4 | 5 | Sanctions/PEP fuzzy match score > 0.65 → compliance analyst approval |
| Card fraud alert triage | Banking | whatsapp, sms, voice, api | 3 | 5 | Confirmed fraud loss > 2,500 → analyst approval before permanent cancellation |
| Chargeback dispute handling | Banking | app, email, branch | 3 | 4 | Amount > 2,500 → dispute team lead approval before provisional credit |
| Early-stage collections outreach | Banking | batch, whatsapp, sms, voice | 3 | 4 | Plan balance > 25,000 or > 3 instalments → collections team lead approval |
| Mortgage document review | Banking | web, email, branch | 3 | 4 | Loan > 3,000,000 or DTI > 45% → underwriting officer approval |
| Voice banking money transfer | Banking | voice | 4 | 4 | Amount > 50,000 or new payee → warm transfer to a call-centre agent |
| Credit card debt payment | Banking | app, voice | 3 | 4 | Amount > 100,000 → branch manager approval |
| Merchant KYB onboarding | Fintech & Payments | web, email | 4 | 5 | Risk tier high or UBO fuzzy match > 0.65 → compliance manager approval |
| AML transaction monitoring alert triage | Fintech & Payments | api, batch | 4 | 4 | Every alert → compliance analyst decision mandatory; the agent never files an STR or closes a case alone |
| BNPL instant instalment decision | Fintech & Payments | api, app, sms | 4 | 5 | Basket > 15,000 or bureau score < 1,200 → underwriter approval |
| Payment reconciliation exceptions | Fintech & Payments | batch, api, email | 3 | 5 | Single break > 10,000 or total > 50,000 → finance manager approval before adjustment |
| Voice claims intake (FNOL) | Insurance | voice, whatsapp | 4 | 4 | Injury or reserve > 250,000 → warm transfer to a claims specialist |
| Policy renewal offer | Insurance | batch, whatsapp, email, app | 3 | 4 | Premium increase > 20% or discount > 10% → renewal team lead approval |
| Underwriting document extraction | Insurance | email, web, batch | 3 | 4 | Loading ≥ 50% or sum assured > 5,000,000 → senior underwriter approval |
| Motor claim photo assessment | Insurance | app, whatsapp | 3 | 4 | Estimate > 15,000 or model confidence < 80% → adjuster approval |
| Subrogation recovery | Insurance | batch, email, api | 3 | 4 | Recovery demand > 50,000 → subrogation counsel approval |
| Where is my order? (WISMO) | Retail & E-commerce | whatsapp, web, app, voice | 3 | 4 | — |
| Returns and refunds | Retail & E-commerce | app, web, whatsapp, email | 3 | 4 | Refund > 2,500 or > 5 returns in 12 months → team lead approval |
| Product Q&A assistant | Retail & E-commerce | web, app, whatsapp | 3 | 4 | — |
| Catalogue enrichment (batch) | Retail & E-commerce | batch, email | 3 | 4 | New category or supplier price deviation > 15% → category manager approval |
| Review response and quality escalation | Retail & E-commerce | web, api | 3 | 3 | 1-star review replies and defect escalations → community manager approval |
| Bill dispute resolution | Telecom | app, voice, whatsapp | 3 | 3 | Goodwill credit > 75 → team lead approval |
| SIM swap fraud check | Telecom | branch, app, api | 3 | 4 | Risk score ≥ 70 or credential change within 72 hours → fraud desk approval |
| Network outage communications | Telecom | sms, whatsapp, api, batch | 3 | 4 | Affected subscribers > 10,000 or P1 outage → network operations manager approval |
| Plan upgrade advisor | Telecom | app, whatsapp, voice | 3 | 5 | Commitment-based or discounted bespoke offer → campaign manager approval |
| Feature delivery pipeline | Software Delivery | api, web | 4 | 4 | Every PR → at least 1 human code review approval; agents never push to main directly |
| CI/CD release pipeline | Software Delivery | api, batch | 4 | 4 | Every production deploy → release-manager approval mandatory; a critical CVE closes the gate automatically |
| Incident response and hotfix | Software Delivery | api, web | 4 | 5 | Every emergency production deploy → on-call engineer approval; the hotfix PR still gets a human review |
| Code review and security gate | Software Delivery | api, web | 4 | 4 | Every PR → human CODEOWNERS approval; a high SAST finding or coverage < 80% blocks the gate |
| Backlog grooming and estimation | Software Delivery | batch, web, api | 3 | 4 | Sprint scope → product owner approval; agents only propose, never commit items to a sprint |
| iOS feature implementation (hired developer agent) | Software Delivery | api, app | 3 | 5 | Every PR is reviewed by a person; production deployment under the team lead’s approval |
| Regression test cycle (hired QA agent) | Software Delivery | api, batch | 3 | 4 | The release “go / no-go” decision stays with the release manager |
| Prior authorization | Healthcare | api, email, web | 3 | 4 | Surgical procedure or cost > 25,000 TL → utilisation management nurse approval |
| Patient intake and triage | Healthcare | app, voice, whatsapp | 4 | 4 | A triage nurse confirms the urgency level on every case; "emergency" cases are directed to 112 immediately |
| Appointment scheduling and no-show reduction | Healthcare | whatsapp, sms, batch | 3 | 3 | — |
| Supplier invoice three-way match | Manufacturing & Automotive | email, api, batch | 3 | 3 | Price deviation > 2% or > 1,000 TL → buyer approval |
| Maintenance ticket triage | Manufacturing & Automotive | api, app, voice | 4 | 4 | Planned stop > 4 hours → shift supervisor approval |
| Warranty claim processing | Manufacturing & Automotive | web, api, email | 3 | 4 | Warranty claim > 5,000 € → regional warranty manager approval |
| Shipment exception handling | Logistics | api, email, whatsapp | 3 | 4 | Extra cost > 1,000 € → dispatch lead approval |
| Customs document preparation | Logistics | api, email, batch | 3 | 5 | HS confidence < 0.90 or duty difference > 2,000 € → customs specialist approval |
| Outage report handling | Energy & Utilities | voice, app, whatsapp, web | 4 | 5 | Mass notification > 1,000 customers → control room dispatcher approval |
| Meter reading dispute | Energy & Utilities | whatsapp, app, web | 3 | 4 | Credit / correction > 1,000 TL → billing team lead approval |
| Rooftop solar connection application | Energy & Utilities | web, email, api | 4 | 4 | The connection opinion is always signed by a network planning engineer |
| Demand response event | Energy & Utilities | api, app, whatsapp, batch | 3 | 4 | Event > 10 MW → grid operator approval; settlement with an audit trail |
| Citizen request routing | Government & Public Sector | web, app, email, voice | 3 | 4 | Classification confidence < 0.85 or staff complaint → registry officer approval |
| Permit application check | Government & Public Sector | web, email | 3 | 5 | Every permit decision is taken by the licensing officer; the system only pre-reviews |
| Public procurement bid file pre-check | Government & Public Sector | batch, web | 3 | 3 | Conformity and elimination decisions always with the tender commission; the agent only prepares |
| Social assistance eligibility pre-assessment | Government & Public Sector | web, app, voice, batch | 3 | 4 | The assistance decision is always with the case officer; the agent pre-assesses |
| Email classification and attachment check | Enterprise Functions | 3 | 4 | — | |
| Call centre quality monitoring | Enterprise Functions | voice, batch | 3 | 4 | Score < 60 or compliance breach → team leader review |
| Contract clause extraction | Enterprise Functions | email, web | 3 | 4 | High-risk deviation or contract value > 500,000 € → counsel approval |
| Employee onboarding | Enterprise Functions | api, email, app | 4 | 5 | Access outside the role template or admin rights → line manager approval |
| IT helpdesk L1 | Enterprise Functions | app, voice, web | 3 | 3 | Access to a finance or production group → group owner approval |
| Accounts payable inbox | Enterprise Functions | email, batch | 3 | 4 | Non-PO invoice > 25,000 TL → cost centre owner approval |
| Sales lead qualification | Enterprise Functions | web, api, email | 3 | 3 | Enterprise (> 1,000 employees) or suspected competitor → SDR lead acceptance |
| Month-end close and reconciliation (hired accountant agent) | Enterprise Functions | batch, email, api | 3 | 4 | Every posted entry and every filing with the accountant’s approval |
| Export control and end-user screening | Defence & Aerospace | api, email, batch | 3 | 4 | Every controlled item → export compliance officer approval; the agent cannot make licence decisions |
| Platform maintenance (MRO) work order preparation | Defence & Aerospace | app, api, batch | 4 | 4 | Every work package affecting airworthiness → maintenance planner approval |
| Supplier security and compliance assessment | Defence & Aerospace | email, web, api | 3 | 4 | The qualification decision always sits with the facility security manager; the agent only prepares |
| Device fleet anomaly triage | IoT & Connected Devices | api, batch, app | 3 | 5 | Bulk device command > 100 devices → fleet operations lead approval |
| Staged OTA update rollout | IoT & Connected Devices | api, batch | 3 | 4 | Rollout to a critical fleet segment → product owner approval; automatic rollback if a health gate fails |
| Cold-chain excursion response | IoT & Connected Devices | api, app, whatsapp | 3 | 5 | Product transfer or disposal decision → quality manager approval |
The SDLC agent team
Within Code Aginies five roles work together in the CI/CD pipeline. They own the process from request to production; code review and the production decision always stay with people. Every step is traced in Jira, Git and CI records.
- Project Manager Agent: triages requests, clarifies scope and dependencies
- Analyst Agent: writes acceptance criteria and test scenarios
- Architect Agent: produces the design and impact analysis
- Developer Agent: implements on a branch and opens the PR
- Tester Agent: generates and runs unit and integration tests, reports coverage
In the CI/CD pipeline SAST, dependency scanning and staging smoke tests run automatically. Production deployment goes to release-manager approval; for hotfixes the same gates apply on a shortened timeline.
Live example: an agent at work
Credit card debt payment
- Request received, session identity verified · channel: app
- Intent: debt payment · Card: ****2210 · Type: full statement balance
- Card debt fetched: 24,860 · due 14 September
- Plan: account selection → OTP → payment → notify
- Accounts listed: current ****7741 has sufficient balance
- Policy: amount ≤ 100,000 → no approval; OTP mandatory
- OTP sent and verified (2 attempts left)
- 24,860 paid from ****7741 to the card · txn #TX-88120
- Spoken and written confirmation given, decision trail stored
- ■completed
Simulation · derived from real agent definitions · every agent can be built by dialogue with the Autonomous Agent and validated with a test corpus