· iWork Technologies Team · AI Governance
Security and Compliance in Agentic Delivery: What Changes When AI Agents Write Code
When an outside team uses AI coding agents on your codebase, the security questions get sharper. Here is how contracts, repository ownership, agent access, data rules and review evidence fit together, and what to ask any vendor before you sign.

Bringing in an outside engineering team has always raised security questions. Who sees the code? Who owns it? What happens to access when the work ends? Add AI coding agents such as Claude Code and OpenAI Codex, and two more questions arrive: what do the agents see, and where does that data go?
Security and procurement teams are right to ask. “Enterprise-grade security” on a vendor’s website tells you nothing. What you need is a description of the controls, specific enough to check.
This post sets out how an enterprise engagement should handle security and compliance when AI agents write some of the code. It describes how we work, and it doubles as a checklist you can hold any vendor to, including us.
Contracts come before code
The order matters. No code, credentials or architecture documents should change hands until two things are signed:
- A non-disclosure agreement covering your code, data, roadmap and anything else shared during the work.
- A clear assignment of intellectual property to you, covering everything produced in the engagement, whether a person or an agent wrote it.
The second point deserves attention. If a vendor’s contract is vague about AI-generated work, ask directly: “Who owns code your agents write for us?” The answer should be you, in writing, without qualification.
For personal data, add data processing terms that match your obligations, for example under GDPR.
The repositories are yours
The cleanest security model is also the simplest: the work happens in your systems.
- Your repositories, in your GitHub, GitLab or Azure DevOps organization.
- Your cloud accounts, under your identity and access management.
- Your secrets manager, holding credentials the vendor’s people and agents use only through it.
This has practical consequences. You can see every access grant, because it lives in your systems. You can revoke any of it yourself, at any time, without asking the vendor. And the code is in your repository from the first commit, so there is no handover moment when ownership is in doubt.
Be wary of arrangements where the vendor develops in its own repositories and “delivers” code at milestones. You lose visibility into who touched what, and you inherit a history you cannot audit.
Scope agent access like you scope human access
AI agents should get the same least-privilege treatment as engineers, with fewer exceptions.
- A dedicated identity for agent work, such as a GitHub App or service account. Not an engineer’s personal token.
- Access to the repositories in scope, and no others.
- Permission to open pull requests, not to merge them. Branch protection blocks direct pushes, and approvals come from people.
- No access to production systems or production data.
- Removal at the end. When the task or engagement ends, the access goes. Because it lives in your organization, you can verify that yourself.
The same applies to engineers’ local sessions. An agent running on a developer’s machine should work from a clone with no production credentials in its environment, and be configured to ignore secret files such as .env files and keys.
Decide what agents may and may not see
Agents need context to be useful, so “agents see nothing” is not a realistic policy. A clear boundary is.
| Agents may see | Agents should not see |
|---|---|
| Source code in repositories you granted | Repositories outside the engagement |
| Technical documentation and architecture notes | Production databases and customer records |
| Test fixtures with synthetic or masked data | Secrets, keys, tokens and .env files |
Agent instruction files in the repo (for example CLAUDE.md) |
Data your policies classify as restricted |
| CI output for their own pull requests | Other clients’ code, ever |
Then control where the data goes:
- An approved tools list. You approve which AI coding tools touch your code before work starts, and can restrict it to what your policies allow.
- Business accounts only. Tools are used through business, team, enterprise or API accounts whose terms exclude customer code from model training, with privacy modes on where offered. Never personal or consumer plans.
- Known retention. Vendors may keep prompts and code for a limited period for abuse and safety monitoring under their business terms. Know what those terms say.
- Your own keys if you need them. If your policy requires it, agents can run under your AI accounts or API keys, so your agreements with those vendors apply instead.
Review evidence that an auditor can follow
“Every change is reviewed” is a claim. Evidence is a record that shows it, for any change, without anyone having to remember.
For agent-authored work, that record should include:
- Which changes an agent wrote. A label on the pull request, a branch naming convention and a commit trailer naming the tool and the engineer who directed it.
- Who approved each one. A named reviewer on every pull request, who is not the author and not the last person to push.
- What checks ran. Tests, static analysis, dependency review and secret scanning, as required status checks, with logs retained.
- Why the change was made. A link from the pull request to a ticket.
- What reached production. A deployment history that ties releases back to merged pull requests.
With that in place, an auditor’s sample of changes can be traced from ticket to production, and the agent-authored ones are easy to pick out.
SOC 2 Type II and ISO 27001 in practice
Certifications and audit reports are useful, but only if you know what they cover. SOC 2 Type II is an independent audit of how controls operated over a period of time, not just whether they were designed. ISO 27001 is a standard for running an information security management system.
On our side, we hold SOC 2 Type II audited controls covering security, availability and confidentiality, and our information security management follows ISO 27001. In day-to-day delivery, those frameworks show up as ordinary, checkable habits:
- Access control. Least-privilege grants, reviewed when scope changes and removed at the end.
- Change management. Every change, human or agent, goes through a pull request, required checks and a named approval.
- Vendor management. AI tools are third-party processors. They are assessed, approved and used under business terms like any other supplier.
- Logging and monitoring. Review records, CI logs and access changes are kept and can be produced.
- Incident response. Exposed secrets are rotated first and investigated second; access can be revoked in one step.
- Secure communication. Project communication and file sharing run over encrypted channels.
Do not take any vendor’s word for this, ours included. Ask for the SOC 2 report under NDA and read the scope and any exceptions. We share ours on request, along with our ISO 27001 documentation, and complete security questionnaires such as SIG and CAIQ as part of procurement.
What to ask any vendor using AI agents
Before you sign with a team that uses AI coding tools, get written answers to these:
- Which AI tools will touch our code, and can we approve or restrict the list?
- What account types do you use, and do their terms exclude our code from training?
- How long can each tool’s vendor retain our code and prompts?
- Can agents run under our own AI accounts or API keys if we require it?
- Where does the code live during the engagement: our repositories or yours?
- What identity do agents use, and what permissions does it have?
- Can an agent merge to a protected branch? If yes, why?
- How are secrets kept away from agents?
- Who reviews agent-written code, how senior are they, and how is that recorded?
- Who owns code an agent writes for us, and where does the contract say so?
- Can we see your SOC 2 Type II report, and what does it cover?
- How is access removed at the end, and how can we verify it?
A vendor who answers these clearly, in writing, is one whose controls you can audit. One who answers with adjectives is not.
Where to start
If your security team is weighing whether outside engineers and AI agents can work on your codebase, start with the questions above and your own policies on data classification and third-party tools.
If you want to talk it through, book a Free AI Readiness Audit. We will go through how agent access, review and data handling would work in your environment. For our specific protections, certifications and the SOC 2 report request, see our security page.


