AI Coding Assistant Security in Regulated Fintech: Rules for Augmented Teams
Three Layers, and the One Auditors Ask About
In July 2025 an AI coding agent on Replit deleted a production database during a code freeze, then described what it had done, according to The Register. The incident is a compact definition of AI coding assistant security. The damage came from what the agent could reach and from the absence of anyone who had to approve it, not from the quality of its code.
For a fintech team the problem has three layers, and the first is the code itself. Veracode’s July 2025 study ran 80 coding tasks through more than 100 language models and found security flaws in 45% of the output. The second layer is the data the assistant sees: your repository, your prompts and anything a developer pastes into a chat window at the end of a long day. The third is the person who answers for the result, and in a regulated build that is the client, the contractor or the tool vendor, depending on the contract.
Security vendors sell scanners for the first layer and the Open Source Security Foundation has published guidance for the second, so the first two layers at least have published answers. In fintech the third layer decides the other two. PCI DSS asks who reviewed the code and whether that person wrote it, and DORA asks what your contracts say about the people and tools that touch your systems. This guide walks through the three layers and then sets out the rules our augmented teams work under on broker and payment projects, with the parts you can copy.
For the prior question of how to staff the build, our guide to staff augmentation vs outsourcing with AI agents covers who owns and who answers under each model.
What Breaks in AI-Generated Code
In the Veracode study the models produced code with an OWASP Top 10 weakness in 45% of tasks, and the spread by language was wide. Java failed above 70% of the time, while Python, C# and JavaScript sat between 38% and 45%. Two weaknesses stood out from the rest, with cross-site scripting failing in 86% of cases and log injection in 88%. Veracode’s own conclusion was that models are getting better at writing code that works and are not improving at writing code that is safe.
Both of those weaknesses cost more in finance than in most other industries. A scripting hole on a payment page is a card-data leak, and PCI DSS 4.0.1 carries a specific requirement for payment page scripts for a related reason. Log injection lets an attacker forge entries in the very record a regulator or an investigator will read after an incident. A model that writes a working transfer flow and an injectable log line in one session has produced two outcomes, and only one shows up in the demo.
The study also found that larger models did no better than smaller ones, which matters when someone proposes a more expensive model as a security measure. The controls that work sit around the model, and the rest of this guide is about those controls.
What the Assistant Sees, and Where It Goes
Modern assistants index the whole repository and send the relevant files along with each request, which means a developer working in one service exposes the others. Scope the assistant to the repositories the engagement covers, and keep card data, keys and customer records out of any repository an assistant can index.
The terms differ by plan, not by product, which is where a policy that names a product and not a plan goes wrong. Since 24 April 2026 GitHub trains on Copilot interaction data from Free, Pro and Pro+ plans unless the user opts out, as heise reported. Business and Enterprise plans are excluded from that program, which are the plans a contractor should be on. Cursor states that with Privacy Mode on, code is not used for training by Cursor or the model providers, and the mode is on by default for Enterprise teams. Read the plan your contractor actually uses, not the product’s marketing page.
Cursor runs most models under zero-data-retention agreements, so the providers do not store prompts or outputs. It names exceptions where a provider keeps inputs for safety review, and an Enterprise admin has to approve those models. Ask the same question of each tool you allow: which models, which retention terms, and which exceptions.
A developer who pastes a production log or a connection string into a chat has moved regulated data to a third party, and no tool setting prevents that. The control that reaches this layer sits upstream of the prompt: the developer has no production data to paste. On our projects that is the normal state, and the section on rules below says how it is arranged.
The Rule, Then What It Changes
PCI DSS 4.0.1, requirement 6.2.3. Bespoke and custom software is reviewed before release to production to identify and correct coding vulnerabilities, and sub-requirement 6.2.3.1 adds three conditions for manual reviews. The reviewer is someone other than the author, the reviewer knows code-review techniques and secure coding, and management approves the change before release. For a team using agents this settles a question engineering blogs still argue about, whether an agent may review an agent. We treat the agent and the engineer who ran it as one author, so in PCI scope a second person reviews each change and a person approves it. An agent reviewing another agent’s output does not meet the text of 6.2.3.1 on its own; the standard is in the PCI SSC document library.
PCI DSS 6.4.3, payment page scripts. Each script that runs on a payment page is authorized, its integrity is checked and an inventory explains why it is there. An assistant that adds a dependency or a tag to a checkout page has changed that inventory without telling anyone. The review step has to catch that change, and the reviewer has to know the inventory exists.
DORA, Chapter V. The EU Digital Operational Resilience Act has applied since 17 January 2025, and Article 28 keeps the financial entity fully responsible for compliance when it uses ICT third-party providers. Article 30 sets what the contracts must contain, from service descriptions and data locations to audit rights and termination terms. A development contractor whose engineers run AI agents inside the entity’s systems can sit in that chain, and so can the agents’ model providers. Whether a contractor counts as an ICT third-party provider under DORA is the compliance team’s call, and the register of information is where that answer is recorded.
The Rules Our Augmented Teams Work Under
Each agent-produced change goes through a pull request, and the agent that produced it does not approve it. Where the change is in PCI DSS scope, a second person reviews it and a person approves it, because 6.2.3.1 asks for exactly that. Outside that scope we let a second agent review the first one’s work, under the rule in card 3. Who approves is set by the engagement: on most of ours our lead approves the merge, and some clients keep approval on their side.
The contract or the onboarding document names the assistants, plans and models allowed on the client’s code, and anything not on that list stays off the project. On fixed-price work, which is outsourcing in the terms used later in this guide, the list is ours and we pay for the subscriptions. On time-and-materials work, which is staff augmentation, the list is the client’s policy. On our own subscriptions client code does not go to a free or consumer-tier tool, and on client-run engagements the client’s policy sets the tier.
When an agent reviews another agent’s change or runs its acceptance tests, it runs on a different model from the one that wrote the code. Code written with Claude Sonnet is checked with GPT-5.5. A model reading its own output tends to agree with it, and the second model is there to disagree.
Card numbers, account numbers, customer records, credentials and production logs do not go into assistants, and the way we make that hold is access. On most fintech projects our engineers have no production access, customer data is seen by a small group inside the client’s company, and the agents see none of it. On those projects developers and their agents work on synthetic or masked data.
Two Ways This Plays Out on Real Projects
The rules above look different depending on who owns the tools and the approval, and our fintech engagements fall into two patterns.
Fixed scope, fixed budget. A client hands us a defined piece of a system with a budget set tight enough that the team used agents as far as they would go. We pay for the tools, Privacy Mode is enforced for the whole team, our lead approves each merge, and the review rules above are ours to keep. The client sees pull requests, acceptance test results and an invoice, and the agents are our problem. This is the outsourcing pattern.
Engineers inside the client’s environment. A client takes our engineers on time and materials and gives them accounts inside its own systems. On one such engagement the generative tools allowed were the Microsoft products already embedded in the company’s environment, and nothing could be sent anywhere else. Our engineers worked with what the client’s policy allowed, the client’s security team owned each setting, and the client’s lead approved the merges. This is the augmentation pattern, and the next section says who answers for the code in each.
Who Answers for Agent-Written Code
Three parties can hold the answer, and the engagement model decides which one does. In staff augmentation the client’s lead directs the work and either approves the merge or delegates that to the contractor’s lead, and the client answers for production. The contractor answers for the engineer: that the engineer follows the client’s rules, uses only the allowed tools and has no production data to put in a prompt. In outsourcing the vendor delivers finished code under acceptance and warranty, so the vendor answers for the code and for the agents it used to write it.
The tool vendor answers for very little in either case. GitHub’s Copilot indemnity, which applies only when the duplicate-detection filter is on, is the usual example of how narrow that is. The practical consequence of that split for a fintech client is contractual: the engagement document names the allowed tools, the data rules, the review rule and who approves. Under DORA that same list belongs in the register of information, and it is the list we work from on team augmentation engagements.
Six Questions for the First Call With a Contractor
The answer should be a list, not a product name, and it should match what the engineers actually have installed.
Enforced means a developer has no way to switch it off, and the admin who enforced it can show you the setting.
You want to know which changes a second person must review and sign under your PCI scope, and the name of the person who approves the rest.
A contractor who has thought about this will name the pairing. A contractor who lets one model grade its own work has not been caught yet.
The right answer is a short list with synthetic data as the default, and a better answer is that the developer has no production data to paste.
A team that has used agents on real projects has a story to tell here, and a team without one has not used them much.
What We Do Not Do
We do not run client code through free or consumer-tier assistants, and we do not let an agent approve its own change. We do not let one model check its own work, and we do not use client code to train models. And we do not promise that an assistant will write secure code, because the Veracode figure is what it is and the review step exists for exactly that reason.
AI Coding Assistant Security in Fintech: FAQ
Yes, on a plan whose data terms the bank has read. Business and Enterprise plans are outside GitHub’s training program, as the card on training above explains. The bank’s own rules on code review and data handling still apply to each change the assistant produces, which is where most of the work is.
Code is not compliant or non-compliant on its own; the process around it is what the standard assesses. Under requirement 6.2.3.1 the change must be reviewed by someone other than its author and approved before release. Treat the engineer and the assistant together as the author and the requirement is met the same way as for a human.
Whoever would be responsible if a person had written it. In staff augmentation that is the client, who directs and approves the work; in outsourcing it is the vendor, through acceptance and warranty. The tool vendor’s liability is limited by its terms, and those terms are worth reading before the first commit.
The same way you audit any code. The pull request records who reviewed the change and who approved it, and neither of them is its author, which is the trail 6.2.3.1 asks for. The standard does not ask you to label which lines a model wrote. Static analysis, dependency scanning and the review by someone other than the author do the rest. If your retention policy covers prompt history, keep it where that policy says.
Yes, both send prompts and code context to model providers to generate completions, and what differs between them is retention and training. The training and retention cards above give the terms for each. Local-only assistants exist for teams that would trade capability for isolation.
On our projects a sub-team of one engineer and two or three agents delivers the output of roughly one and a half to two engineers, depending on the stage and the codebase. On legacy code the gain is smaller, although review goes faster; on new code integration is quick and later changes get harder. The release itself speeds up less than the demo suggests, because review and the audit trail do not get faster when the typing does.
The Part You Can Copy
Three of the four rules above are PCI DSS 6.2.3 and DORA Article 30 read with an agent in the room, and the fourth, a second model for review, is our own. What changes is who the author is, and the answer has not changed: a person who did not write the change reads it, and a person signs it.