Start with the platform that already exists
The first integration decision is where the business rules live. They may be in a service layer, database constraints, a workflow engine or a mixture. Identify how the product authenticates users, selects a tenant, validates mutations and records audit events. A new AI feature that bypasses those rules creates a parallel application with different behavior.
| Contract | Questions to resolve |
|---|---|
| Identity | Who initiates the task? Which user or service identity reaches each downstream system? |
| Data | What is authoritative, cached, derived, restricted or stale? |
| Mutation | Which API owns validation, concurrency and duplicate prevention? |
| Events | Can deliveries repeat or arrive out of order? What identifies an event and a business operation? |
| Failure | How is a timeout distinguished from a rejected request or an unknown outcome? |
| Ownership | Who maintains connector versions, schema changes and operational runbooks? |
Choose a narrow integration boundary
A useful starting point is a task-oriented domain API: propose an account update, assemble an order exception or retrieve the records needed for a case. Avoid handing an agent broad database access because it is easier to demo. The narrow contract should still enforce the same business rules for every caller.
Resource-level permission checks belong on the server, using trusted caller context. If the AI runtime supplies an account or tenant identifier, the domain service must verify that it is in scope. Authentication alone does not establish permission to read or change that resource.[1]
Use a read model or index when it helps retrieval, but document its freshness and access rules. An index is a projection of business data, not an excuse to serve a revoked document or commit against an outdated account version.
Worked integration: account-change proposals
Imagine an established SaaS product with a customer-success console and a domain API for account changes. The proposed AI feature reads support history and drafts a configuration adjustment. The existing API already validates the account version and the operator’s permission to change each setting.
- Add a proposal endpoint that accepts a task ID and a constrained change schema. It records a suggestion without mutating the account.
- Use authorized read tools to gather account context. Preserve source versions and references with the proposal.
- Render the before/after change in the existing console. Let the operator reject, edit or approve it under the current policy.
- Commit through the existing domain API with a stable operation ID and the expected account version.
- Record the result and expose a clear status to the initiating user. An AI runtime failure should not leave the console claiming success.
This preserves one mutation path while allowing the user experience to improve. If the organization later permits selected low-consequence actions without individual review, the same contract can enforce that policy. The decision should be based on evidence for the specific action class, not the fact that the feature uses an agent.
Design event and timeout behavior explicitly
An event-triggered integration should distinguish the delivery ID from the business-operation ID. A duplicate delivery should not create a new task that repeats a committed action. A revised customer request, however, may be a genuinely different operation and should not be accidentally suppressed.
Idempotency requires more than storing a key after success. The mutation and operation record need appropriate transactional or downstream guarantees, and the key must remain associated with the intended payload. AWS’s treatment of idempotent APIs explains the importance of client intent when deciding whether two requests are the same operation.[2]
| Outcome | Caller behavior |
|---|---|
| Rejected before execution | Correct the request or stop; do not retry unchanged indefinitely. |
| Committed with a result | Store the result and complete the task. |
| Known transient failure before mutation | Retry within the bounded policy using the same operation identity. |
| Outcome unknown | Query or reconcile the original operation before issuing another mutation. |
Roll out without a second set of business rules
Begin with a narrow workflow and an observable acceptance criterion. A shadow phase can compare proposed actions with the existing process, provided shadow execution cannot produce real side effects. Then expose proposals to a limited group and inspect disagreement, review time and support burden before increasing authority.
Keep the old path available during the transition when the product can support it. Document what a rollback disables, what happens to in-flight work and which already-committed actions cannot be undone. Software delivery discipline—including repeatable builds and verification—still applies to the integration.[3]
Define what each rollout stage must establish before the next one starts.
The integration deliverable is a maintained contract
Require more than a working connector. Ask for field mappings, schemas, credential scope, rate-limit handling, failure-state examples, migration steps and a connector ownership record. Include representative fixtures so the next API revision can be tested before it breaks a live workflow.
The end state should be understandable to the team that runs the platform. They should know which system owns each record, how to disable the new workflow, how to reconcile a failed task and how to change the integration safely. Those are the conditions that make an AI feature part of a product rather than a permanent exception.
Sources and scope
Technical references inform the cited statements. The decision frameworks and synthetic examples are TeqEngine’s editorial guidance.
- OWASP: Authorization Cheat Sheethttps://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html
- AWS Builders’ Library: Making retries safe with idempotent APIshttps://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/
- NIST: Secure Software Development Framework, SP 800-218https://csrc.nist.gov/pubs/sp/800/218/final