A runnable Python reference for controlling what an agent may do: approve a specific action, enforce its limits, and recover from a lost response without duplicating CRM records.
Public scope: working reference code and architecture documentation. Agent behaviour and the CRM are simulated; commercial implementations remain proprietary.
Requires Git and Python 3.12 (the tested version). No API keys or third-party Python packages are needed.
git clone https://github.com/Poochaman/enterprise-agentic-ai.git
cd enterprise-agentic-ai
python -m reference.smokeRun Python commands from the repository root. On systems that name Python 3 python3, substitute that command.
Expected result: seven HTTP smoke checks pass. They cover approved execution, replay, approval expiry and revocation, revised proposals, batch limits, tenant isolation, and the final mock CRM records.
For the narrated recovery example, run these commands in the same PowerShell session:
$demoData = '.reference-data/demo-' + [guid]::NewGuid().ToString('N')
python -m reference.demo --data $demoData
python -m reference.demo --data $demoDataThe first run simulates a CRM write succeeding while its response is lost, then recovers the existing result. The second returns the completed result without creating another lead. The runbook explains the output and provides other run options.
Run python examples/run.py from this folder and open http://127.0.0.1:8877.
| Browser example | What to explore |
|---|---|
| Agent Control Room | Proposals, approvals, action limits, revocation and response-loss recovery through the existing engine |
| Programme Intelligence | A supplier-delay scenario, calculated schedule impact and optional source-linked AI commentary |
| Model Evaluation | Local routing baselines, optional live models, failed cases and downloadable results |
All three have runnable no-key modes. Live AI is opt-in and requires your own provider credentials. Setup, scope and tests.
| Engineering concern | Observable behaviour |
|---|---|
| Separation of proposal and approval | A requester proposes an action; a separate approver authorises its exact digest. |
| Bounded authority | Approvals expire, can be revoked, and limit the number of CRM records. |
| Changed instructions | Revising a proposal invalidates its approval. |
| Tenant boundaries | Identity determines tenant access; client overrides are rejected. |
| Recovery after response loss | The workflow reconciles the committed mock CRM result before considering another write. |
| Reviewable execution | Persisted state and event traces show routing, approval and execution decisions. |
These checks demonstrate behaviour in the local reference. They do not measure model quality, production throughput or a real CRM integration. The mock identity and persistence model need production-specific replacements and validation.
| Resource | What to inspect |
|---|---|
| Reference runbook | Demo, HTTP service, evaluation commands and implementation limitations |
| Workflow implementation | Authority checks, persistence, tool execution and recovery |
| HTTP contract | The reference service's workflow endpoints |
| Scenario cases | Deterministic inputs and expected outcomes |
| Automated tests | Workflow and authority regression coverage |
| Architecture | Enterprise layers and integration boundaries |
| Agent flow | Routing and execution design |
| Illustrative API payload | Broader architecture example; separate from the runnable HTTP contract |
The wider design connects client interfaces, APIs, specialist agents and controlled tools to enterprise systems. Applications include sales/support workflows, internal knowledge assistants and process automation.
The key design choices are explicit routing, permissions enforced outside the model, durable workflow state, and separation between reasoning and external effects. A stateless conversation API can still depend on persistent approvals, audit records and recovery state.
The code and documentation published in this repository are licensed under the MIT License, permitting commercial use, modification and redistribution subject to its terms.
Separate commercial implementations, deployments and services from AI Venture X are not included in this repository and remain proprietary. This distinction does not restrict the rights granted by the MIT licence for the published reference.
Richard Russell · Founder, AI Venture X
Controlled agentic AI guide · Technical profile and featured work · Discuss an integration · LinkedIn