Write an agent integration doc security will accept
Security sends the agent back when the doc names a vendor and skips the methods. Copy this field list into the repo and fill every method ID from the CLI.
Key takeaways
- -A vendor name doesn't tell security which operation you're calling. Name the method ID from swy list methods instead.
- -If the provider doesn't store an idempotency key, say the write can land twice. Don't claim exactly-once.
- -Hosted log retention is 7 days on Free, 30 on Pro, and 90 on Business, and only once storage is turned on.
- -Paste the template into docs/agent-integration.md next to tooling.json. That's the file review will actually diff.
A requirements doc says the agent will “integrate with the CRM and the billing system.” Security review takes about twelve minutes. The reviewer asks who the call acts as, which fields come back, whether a write can fire twice, and how to turn it off, and the doc answers none of it. The review comes back as “insufficient,” and the launch slips a month over a missing table.
This is the field list reviewers actually ask for, as a template you can paste straight into the repo. Fill the blanks with method IDs pulled from your own machine, not with vendor names.
What gets the doc sent back
Reviewers don’t block you because the writing is informal. They block you because a vendor name hides the operation. “Salesforce” could mean a read of one Account, or a write that changes who owns it, and those are two very different reviews. Our post on API compliance for agent integrations covers the control side in more depth; this one is how you show those controls for a specific project.
A second way to get bounced: a doc that describes the model and never the runtime. The reviewer needs the allowlist, the policy file path, and what happens when an argument is wrong. “The model is instructed not to issue refunds” isn’t a control. A policy that blocks the method is.
If you want the short version first, start with our checklist before company data touches an agent. The template below is what you leave attached to the ticket so the next reviewer doesn’t start from zero.
The template
Copy this into docs/agent-integration.md, in the same repo that holds tooling.json. Replace every angle-bracket note, and if you don’t know a value yet, write “unknown” rather than marking the review ready.
# Agent integration requirements
## Owner
Name and team that will merge changes to tooling.json.
## Who the call acts as
The end user, a service account, or a shared bot. One sentence on how they consent.
## Data classes
Customer, employee, payment, or public. Name the fields that come back.
## Methods
IDs copied from `swy list methods` after `swy get`. One per line.
Mark each read or write.
Do not paste a vendor name in place of an ID.
## Writes
For each write: can the provider store an idempotency key.
If it cannot, say the call is not exactly-once.
## Approval
Which writes wait for Slack or Telegram.
Approval starts on Business and Enterprise.
If nobody answers within 48 hours, the call does not run.
## Policy file
Path: .swytchcode/integrations/policies.json
Tests: what `swy policy validate` must pass before merge.
## Logs
Hosted log storage is off until you turn it on.
Retention: 7 days Free, 30 days Pro, 90 days Business.
Local check: `swy audit stats`.
## Credentials
There is no .env file in this project.
Swytchcode keeps credentials in its own local store and reads them when a call runs.
Command: `swy auth connect <provider>`.
## Out of scope
Methods you downloaded and will not enable in this release.
## Rollback
Remove the method ID from tooling.json and merge.That’s the whole template. There’s no separate download; the copy that lives in git is the one review will actually diff against the pull request.
Why these fields are the review
Owner is whoever can merge a method onto the allowlist, so a shared inbox fails this line immediately. Who the call acts as is the difference between the end user’s own token and a bot that can see every record in the system. Data classes tell the privacy reviewer whether this ticket is the same one they already run for payments or employee data, or something new.
Methods carry the real weight here. One ID per line, copied straight from the CLI, each one marked read or write. A vendor name in that slot means the operation hasn’t actually been chosen yet. Every write needs a line on idempotency: if the provider doesn’t store a key, say so plainly, since the call can land twice. Approval should name both the channel and the plan it’s available on. Slack and Telegram holds exist on Business and Enterprise; a Free or Pro project that lists one is describing a feature the plan doesn’t have. The honest line in that case is simply “this write stays off.”
The policy path and its tests give the reviewer something they can rerun themselves. Logs should state the retention you actually have: 7 days on Free, 30 on Pro, 90 on Business, and only once storage is turned on. Credentials stay out of the repo entirely. There is no .env file in this project, since Swytchcode keeps credentials in its own local store and reads them when a call runs. Out of scope is the list of methods you downloaded and chose not to enable. Rollback is the one-line revert everyone wants to see: delete the ID from tooling.json and merge.
How to fill the method lines
Run the CLI and paste what it prints. The command reference is the place to check if a subcommand looks unfamiliar.
swy search <provider>
swy get <name from swy search>
swy list methods
swy info <canonical_id from swy list methods>swy info only works once a method is local. If search comes back empty, say so in the doc: the provider isn’t in the registry yet, and name who owns the bring-your-own work to add it (Business and Enterprise plans can add it). Don’t leave that row as “TBD” with a launch date sitting on top of it.
For any write, state plainly whether the provider stores an idempotency key. If it doesn’t, don’t write that the runtime makes the call exactly-once. A retry can still land twice, and the Writes section is where the reviewer should learn that, not production.
What you attach to the ticket
Link the markdown file itself, the policy tests, and the pull request that enables the first method. A screenshot of a chat thread isn’t a substitute. The reviewer’s next question is always what happens when the argument is wrong, and the answer is the test swy policy validate already runs.
Mark the review ready only once every method line is an ID you can still find with swy list methods. A renamed integration that leaves stale IDs sitting in the doc will fail the next review for a reason the CLI would have caught in ten seconds.
Paste the template into the repo, fill the method IDs from swy list methods, and attach that file to the security ticket before you ask for a date.
Related reading
- Policy as code for agent calls. What the Policy file section is pointing at.
- Human approval for a tool call. How the Approval section behaves on a real write.
- API governance tools for AI agents. Where this doc sits next to the allowlist.
- Log every API call an agent makes. How you show the retention line is true.
FAQ
Can I name the vendor and skip method IDs?
You can, but the review will come back. A vendor exposes many different operations, and the reviewer is really signing off on specific ones. Copy them from swy list methods instead.
What if I don’t know whether the provider stores an idempotency key?
Write “unknown” and link the provider’s own docs once you’ve actually read them. Don’t claim exactly-once in the meantime. “Unknown” is a perfectly good reason to leave that write out of the first release.
Does this replace a data protection review?
No. The data class line tells that review where to look; it doesn’t finish it for them. Payment and employee fields still need whatever review your company already runs for those classes.
Where should the file live?
Right next to .swytchcode/ in the repo that ships the agent. Review diffs the doc against the same pull request as tooling.json, so a wiki page nobody updates will drift within a week of launch.
Use Swytchcode so this doesn't happen to you
Use Swytchcode so your integration doc can name exact method IDs, policies, and a real audit trail, instead of a vendor name that gets security review sent back.
Swytchcode is an execution kernel that sits between your AI agents and the APIs they call. It resolves the right method, injects auth, checks policy, retries safely with idempotency, and logs every call locally.
Start with the MCP quickstart, or browse the docs for the full reference. Free is 100 live commands a month forever; see pricing for Pro and Business.
More content
How to Stop an AI Agent From Booking the Same Meeting Twice
A scheduling agent that checks availability and then books the slot has a gap between those two steps — and a retry can fall straight into it. Here's how Swytchcode closes that gap.
How to Stop an AI Agent From Creating Duplicate Records
A retried "create" call doesn't update an existing contact, ticket, or row — it makes a second one. Here's why that happens across CRMs, databases, and ticketing tools, and how Swytchcode prevents it.
How to Stop an AI Agent From Sending the Same Email Twice
Most email APIs have no idempotency key to catch a repeat send, which makes a duplicate email a harder problem than a duplicate charge. Here's how Swytchcode handles the gap.
