What can go wrong with coding agents
Treat the agent as an insider who may be working for someone else, and limit what a hijacked agent could reach or send out. It reads strangers' text, any of which can carry instructions, and runs code with whatever credentials its environment exposes. Every incident of 2025-2026 turned on a credential within reach, a system the agent could touch or an open path out, never on unusual model intelligence (chapter 01 tells the stories).
All ten agent-specific threats, with the incident behind each 10 rows
Each row pairs a threat with what happened and the lesson the design takes; 10.2 gives the control and its evidence.
| Threat | What happened | What it teaches |
|---|---|---|
| Forged or shaped proof | No public incident yet. Our red team found that early drafts let agent code write the test reports that were then signed. | Agent code must neither sign nor shape its own proof (chapter 06). |
| Credential theft from the VM | The Claude Code GitHub Action's Read tool exposed the API key through /proc/self/environ (fixed in 2.1.128).13 In the TanStack wave, an OpenID Connect (OIDC) token was read from runner memory.10 | Nothing in the VM may be worth stealing. Tokens are run-scoped and short-lived. |
| Exfiltration | Comment and Control (April 2026): PR titles and hidden HTML comments hijacked three vendors' agents running in GitHub Actions. Copilot's firewall allowed github.com, so secrets left base64-encoded through git push.1 | An allowlisted code host is an exit. Agents push only through a broker. |
| Prompt injection | Clinejection: an issue-triage bot built on claude-code-action was injected. A stolen npm token led to an unauthorised cline@2.3.0 release.89 | A bot that reads strangers' text must not hold write tools and secrets together. |
| CI poisoning | Mini Shai-Hulud, TanStack wave (11 May 2026): pull_request_target, then cache poisoning, then an OIDC token read from runner memory, then 84 malicious publishes with valid provenance.10 | Secrets live only where PR code never runs. Caches are not shared with untrusted jobs. |
| Guardrail edits | In the earlier SAP wave (29 April 2026), the malware committed a .claude/settings.json into victim repositories.10 | Agent configuration supplied by a repository must never take effect unreviewed (10.3). |
| Self-approval | GitHub stops authors approving their own PRs, but nothing native knows who asked an agent for the change.14 | The bank owns its own independence check (chapter 09). |
| Runaway agent | NewCore (reported 4 November, published 17 November 2026): bots kept making unrequested reads after an owner declined four times, and none appeared in their own chat history. NewCore sells gateways, so it is an interested party.1112 | A “stop” is a prompt. Kill switches and logs must sit outside the agent. |
| Malicious packages and plugins | Plugin4Shell (disclosed 17 September 2026): plugin auto-update gave zero-click remote code execution, fixed in Claude Code 2.1.179.15 OpenAI's evaluation agents used an internal package proxy to reach the internet and breached Hugging Face.1617 | Package proxies are egress. Plugins and skills are code to pin and review. |
| Shadow AI | Finanstilsynet's ROS 2026 (its risk and vulnerability analysis) expects an overview of all ICT and AI solutions in use, “including unauthorised ones”.18 | Block unapproved tools on managed devices and inventory the approved ones. |
Two assumptions drive every control here: the agent can read all memory in its VM, including anything the bootstrap left behind, and a “stop” typed in chat is only a prompt. Real stops terminate compute and revoke tokens from outside the agent.
Twelve risks, twelve controls, and the evidence for each
Each risk has a control outside the model and evidence an auditor can check, mostly a probe, bypass bundle or red-team case that must fail. The two-week red-team spike S2, on a frozen build in weeks 10-12, must pass before gate W-tech opens hosted runs to all engineers (chapter 17).
Most of the twelve controls make one of five moves:
- Nothing to steal. No job that runs PR code holds secrets or write tokens; agent tokens are run-scoped and short-lived.
- No way out. No NAT gateway, an exact-host proxy, and endpoint policies limited to the bank's AWS organisation.
- Propose, never write. Agents push through a broker that blocks protected paths and unapproved dependencies.
- Independent approval. A fail-closed check stops the requester, pushers, commit authors and bots from approving.
- A stop outside the agent. Budgets at the model gateway, a 4-hour cap and a four-action kill switch.
All twelve risks, with the control and evidence for each 12 rows
The full matrix adds the supply-chain, harness, laptop and shadow-AI controls, and names the evidence an auditor checks for each.
| Risk | Control | Evidence |
|---|---|---|
| Forged or shaped proof | No job that runs PR code holds secrets or write tokens. verify-run tests the head with the harness layer from main; black-box suites run in a second VM. The notary checks the harness tree hash and the gateway's witness chain before it signs. | Notary logs; S2 forgery case |
| VM credential abuse | One bootstrap per run; run-scoped tokens; a pull-only instance role usable only through the bank's VPC endpoints; instance metadata limited to one network hop and blocked for the agent user; no SSM parameters. | S2 |
| Exfiltration and the data perimeter | No NAT; an exact-host proxy allowlist; VPC endpoint policies limited to the bank's AWS organisation plus named AWS buckets; package groups that block upstreams by default;19 image pulls only from approved prefixes; a field allowlist at the model gateway; a recorded TLS-inspection decision per destination. | Deny and positive probes; S2 |
| Prompt injection | Rule of Two per profile (below); propose-only writes; a quarantined reader for customer text; the canary injection suite nightly and on every harness or model change (10.4). | Suite results; red team |
| CI poisoning | Secrets only in environments limited to main and the merge queue, or behind OIDC trust that requires refs/heads/main. The default GITHUB_TOKEN is read-only. Trusted runners serve only selected main workflows. Workflow lint (zizmor) and policy checks (OPA) are required. No cache restore in verify or agent/** workflows. | Policy-check output |
| Agent edits guardrails | The broker blocks protected paths; sessions on agent-authored branches read instructions from the base commit (10.3). | Conformance suite: one bundle per bypass class |
| Self-approval | sod/independence excludes the requester, sponsor, pushers, commit identities, bots and, on T2, adopted contributors. It requires attestations and fails closed. | Check suite incl. the contributor case; monthly SoD report |
| Runaway agent | Budgets enforced at the gateway that fail closed; a 4-hour cap; at most 2 CI rounds; a four-action !stop: cancel compute, revoke the token, attach an IAM deny, mark the registry. | Kill-switch drill |
| Malicious packages and plugins | A server-side 72-hour age gate through promotion from a staging repository; install scripts off and lockfiles frozen in the image, not in repo files; the broker blocks unapproved direct dependencies; software bills of materials (SBOMs); bank-owned skills; plugin auto-update off. | Promotion log; SBOMs |
| Harness vulnerability | requiredMinimumVersion at 2.1.179 or later (Plugin4Shell);2015 weekly harness bumps as a standard change. | Inventory |
| Laptop lane | Managed settings deny reads of ~/.aws, ~/.ssh, ~/.config/gh, ~/.docker, ~/.kube and secret variables; managed domains only; a Bedrock-only permission set; ./x refuses agent/* checkouts outside a sandbox. Claude Code's own sandbox covers shell commands only; file tools, MCP servers and hooks run outside it.21 | Laptop probe |
| Shadow AI | Mobile device management (MDM) blocks unapproved tools; AI systems are listed in the ICT asset inventory.18 | Inventory |
The Rule of Two, profile by profile
Meta's Rule of Two says an agent session should hold at most two of three properties: untrusted input (U), access to sensitive systems or data (S), and the ability to change state or communicate externally (C).22 Of the bank's agent profiles, only Investigate and Implement need all three; both are propose-only with closed egress, and Implement's proof is produced outside the agent. A label or a system-prompt line never counts as compensation.
Rule of Two for all eight agent profiles, with what compensates 8 rows
Shaded rows hold all three properties. Triage and Ops arrive only at later gates.
| Profile | U | S | C | What compensates |
|---|---|---|---|---|
| Coordinator | Yes | No | Yes | Intake call has no tools; posts go only to the originating thread |
| Ask | Yes | Yes | No | Read-only VM and read-only token |
| Investigate | Yes | Yes | Yes | Propose-only (draft PR, findings); closed egress |
| Implement | Yes | Yes | Yes | Propose-only; closed egress; proof produced outside the agent |
| Review | Yes | Yes | Via poster | The model step has no tools; a non-LLM poster writes comments |
| Research | Yes | No | Yes | No repository, secrets or internal network; queries DLP-checked and logged |
| Triage (gate F1) | Enums | Yes | Yes | Free text reaches it only as typed values from a quarantined reader |
| Ops (gate O) | — | — | Proposal | A non-LLM apply service validates parameters; on-call approves with step-up sign-in |
Agents cannot edit their own guardrails
The broker refuses agent changes to anything that configures agents, CI, policy, builds or packages, and sessions on an agent's branch read their instructions from the base commit. Otherwise an agent could switch off the controls that watch it, as the SAP wave of Mini Shai-Hulud did to its victims by committing a .claude/settings.json.10
Changes to these paths are human work at the highest review tier, T2 (chapter 09); control components, marked † in chapter 03, also need an outside approver (10.6).
The protected paths and rejection rules, as a generated policy file 24 paths · 6 rules
Agents may not write to any of these paths, and the broker rejects the listed change types outright. The policy is generated from review-tiers.yml, which also generates CODEOWNERS and the GitHub rulesets, so the three cannot drift apart.
# Generated from review-tiers.yml. Do not edit by hand.
agent_write_denied:
# agent, CI and policy configuration
- .github/** - .claude/** - .agents/** - .codex/**
- CODEOWNERS - policy/** - tools/agent-hooks/**
# infrastructure, images and the build entry point
- infra/** - images/** - ./x - .moon/** - mise.toml
# package and registry configuration
- .npmrc - pnpm-workspace.yaml - uv.toml - settings.gradle.kts - renovate.json
# catalogs and repository plumbing
- catalogs/** - .gitattributes - .gitmodules - .lfsconfig
- .devcontainer/** - .vscode/** - .envrc
reject:
symlinks: true
submodules: true
case_or_unicode_collisions: true
exec_bit_changes: unless_listed
oversized_blobs: true
external_urls_in_markup: true
Instruction poisoning
Instructions planted in AGENTS.md on the agent's branch would be obeyed by the next session there, such as a reviewer or a resumed run. So every session on an agent-authored head reads its instruction files, read-only, from the base commit. This overlay is not yet proven: spike S3 (weeks 6-8) tests it, along with verified resume.
Deep dive: which sessions and files the base-commit overlay covers 1 min
Every session on an agent-authored head (review, the cross-vendor interrogate seat, resume, Babysit, maintenance, drills) mounts AGENTS.md, CLAUDE.md and .codex/ read-only from the base commit, with project setting sources excluded. Instruction files a PR changes are T2 and shown to reviewers first (chapter 05).
The red-team spike S2 tries a poisoned branch AGENTS.md among every broker bypass class. Research output goes only to research/** and is untrusted input for every other agent.
Prompt injection: structure, not promises
Injection cannot be filtered out reliably, so the design makes a hijacked agent harmless: it cannot see anything sensitive, cannot act, or cannot send anything out. Defences inside the model's context were broken by adaptive attacks more than 90% of the time. Deterministic defences outside the model look far better, but mostly on static benchmarks: the one independent adaptive test, of one defence on one small open model, cut attack success from 25.8% to 4.2%.23 Encouraging, not proof.
- Profile separationNo session holds untrusted input, sensitive access and a way out at once.
- No exfiltration channelExact-host egress; credentials outside the VM; no path to github.com (figure below).
- Policy on tools and argumentsEnforced outside the model:
slack.postonly to the originating thread, comments only on the session's own PR. - Quarantined readerA tool-less model call turns customer-controlled text into typed values, so the planner never sees free text.
- Hash-pinned tool listsThe gateway fails closed if a tool list changes mid-session.
- Output hygieneMasking and provenance labels: helpful but probabilistic, so not a boundary.
Vendor promises that the model treats other people's posts as information, not instructions.24 Vendor read-only or lockdown modes, which GitHub itself calls “not an authorization boundary”.25 System-prompt instructions. A user telling the bot to stop: the NewCore bots carried on after four refusals.11
Deep dive: how S2 tests the closed paths, and the research profile's narrower perimeter 1 min
The red-team spike S2 tries the closed paths rather than trusting them: presigned PUTs through every endpoint, and instance metadata from the agent user, from containers and from outside the VPC. It also tests exfiltration through package or image names and through rendering surfaces.
The figure shows the code profile. The research profile reaches only the gateway, the broker and a query-stripping fetch proxy (plus AgentCore Web Search in eu-west-1 from month 4).
The canary injection suite
A canary suite checks that the perimeter holds. From weeks 5-8 it plants fake secrets where agents read (issues, PR comments, READMEs, CI logs, Slack, web pages); a pass means zero canary egress and zero unauthorised state change. It runs nightly and on every harness or model change, and is a gate W-tech criterion (chapter 13).
What a passing canary run looks like, as an illustrative terminal 7 lines
$ ./x evals injection --suite canary → planted in: issues, PR comments, READMEs, CI logs, Slack, web → profiles: implement, investigate, research → canary egress (proxy, gateway, broker, outbox) 0 → unauthorised state change (git, tickets, Slack) 0 → egress-denial alerts raised to the SOC expected PASS W-tech criterion: injection suite
DORA: every surface classified, registered and given an exit
Every vendor and surface is registered and assessed for whether it supports a critical or important function, and the non-negotiable model contract gets a documented risk acceptance before wide use. DORA, the Digital Operational Resilience Act (Regulation (EU) 2022/2554), has applied in Norway since 1 July 2025, its technical standards incorporated by DORA-forskriften. A licensed bank gets the full standard for information and communication technology (ICT) risk, the regulatory technical standards (RTS) 2024/1774, not the simplified one.3275
The large language model (LLM) route does not support a critical or important function (CIF) while no agent output reaches production without independent human approval and agents have no production write or unmasked access. Source control, CI and the control plane sit in the change path of critical systems and may support a CIF, as many banks classify them. ICT risk assesses each surface, approves the result and records it in the register of information (RoI).
BaFin's guidance draws the same line, contrasting AI built into critical functions with assistants “completely under human supervision and… not involved in decision-making processes”.4 The position is conditional and must be reassessed, with any filings, before any of these happens:
- T0 changes merge without in-the-moment human approval (gate F2, month 9 or later);
- agents get production data access, or an apply service exists (gate O);
- an LLM enters a runtime path of the bank;
- the bank can no longer patch without agents.
A surface classified as CIF-supporting triggers five further duties, starting with a notification to Finanstilsynet at least 30 days before go-live.3
The five duties a CIF-supporting surface triggers 5 items
- a notification to Finanstilsynet before go-live, which DORA Art. 28(3) requires for planned CIF arrangements,3 filed on form KRT-1121 at least 30 days ahead (a deadline this research confirmed through a law-firm summary, not Finanstilsynet's own text);
- the additional Art. 30(3) contract clauses;
- a tested Art. 28(8) exit;
- RoI rows that list the subcontractors behind it (template B_05.02);28
- access-rights updates at least every six months.5
The model contract
Claude on Bedrock runs under two contracts whose gaps the bank cannot negotiate away.2930 AWS's DORA addendum is not public, so the plan assumes it does not cover Anthropic-sold models,31 and Anthropic says its terms “are not open to negotiation”.32 So before Claude use goes beyond the platform team, ICT risk produces three things:
- an Art. 30(2) clause map of both contracts, listing the gaps;
- an Art. 28(4) risk assessment, with due diligence and a concentration record;
- a risk acceptance under the management body's ICT third-party policy, with compensating controls: route and contract tags, retention set to none and the drilled Codex exit (chapter 11).
Deep dive: the contract parties, the private-offer route and the interim acceptance 1 min
The AWS agreement is with AWS EMEA SARL. The Anthropic on Bedrock – Commercial Terms (version 2025-08-18) are with Anthropic Ireland under Irish law. Claude counts as AWS “Third-Party Content”, invoiced by AWS Inc.2930 AWS offers a DORA Financial Services Addendum on request, but its text is not public.31
A Bedrock private offer is the intended vehicle for a DORA addendum; whether it can carry one is unverified. Meanwhile the platform team's own use in weeks 0-4 runs under a time-boxed interim acceptance by ICT risk (our inference of what is proportionate).
Every provider in use gets an exit tier: drilled (A), like the quarterly Codex drill for Anthropic, or a written plan tested against fakes (B). AWS is on the European Supervisory Authorities' (ESAs') list of critical ICT third-party providers, which does not reduce the bank's own duties (chapter 12).33
Register of information and exit tiers, provider by provider 7 rows
ICT risk assesses six surfaces: Bedrock and Anthropic, GHE.com, Actions and runners, the control plane, the evidence store and Slack. The ESAs' list names 19 critical ICT third-party providers (CTPPs), including AWS EMEA SARL and Microsoft Ireland Operations. It names no LLM lab and not Cloudflare, and no 2026 update was found as of 24 November 2026.33 Whether Microsoft's oversight covers GitHub is not public.
| Provider | Route, data, location | Exit tier and plan |
|---|---|---|
| AWS EMEA SARL (CTPP); AWS Inc. invoices Claude on Bedrock | eu-north-1, eu-central-1, eu-west-1. Open questions on the addendum's scope and on concentration | B: image, Terraform and ./x run on any VM host. A (tested redeploy) if the control plane or CI is assessed CIF-supporting |
| Anthropic Ireland | Bedrock eu.; code and prompts (green data only) | A: quarterly Codex drill |
| GitHub (GHE.com, EU) | Bought through the Microsoft agreement; DORA coverage question open | A if CIF-supporting: forge-export test |
| Azure OpenAI Data Zone EU | Drill code, T1 work, and T2 diffs except keys, identity and anti-money-laundering (AML) paths; models pinned to versions that keep Modified Abuse Monitoring | Is the exit |
| Entra ID; Slack (Enterprise+, EU) | Identity root; Slack gives visibility, not the record | Bank plan; B |
| MDM vendor; ticket system; Sentry EU (US SaaS); Snyk if remote | Registered before first use. “RoI row exists” is a gate criterion | B |
| Not used | Cloudflare; Grok Bot and Cursor cloud agents for bank work; Anthropic-hosted sessions; hosted AI review; Docker Desktop; LiteLLM; SaaS eval platforms; the Google eu route in year 1 | |
Who controls the controls: people outside the platform team
The people who build the platform cannot alter its evidence or approve changes to its control components. RTS Art. 21 asks for segregation of duties that prevents “combinations of access rights that may be used to circumvent controls”, and privileged access only on a need-to-use basis.5 A platform team that could edit the broker policy, approve its own change and delete the record would be exactly such a combination. As Datatilsynet puts it: “En KI-aktør trenger en definert identitet, tydelige rammer for tilgang og et klart ansvarsforhold” (an AI actor needs a defined identity, clear limits on access and a clear line of accountability).34
- Outside admins. Named security and ICT-risk staff run the evidence accounts and the Organizations management account under dual control, with alarms on
CloseAccount,LeaveOrganizationand key-policy changes. - Outside approvers from a CODEOWNERS team the platform team cannot join, for changes to † components:
review-tiers.yml, the broker policy, egress allowlists and machine-image records. - Two-person break-glass from outside the platform team; every bypass alerts and gets a post-implementation review.
- Six-monthly recertification of GitHub App permissions, entitlements, break-glass holders and evidence admins.5
- Reporting covers the platform team too. The monthly segregation-of-duties (SoD) report covers contributors and every platform-team bypass and admin event; by month 6, the ledger and anti-money-laundering (AML) domains each have three approvers who are not the requester (chapter 15).
Personal data: synthetic for customers, three purposes for employees
Customer data never enters agent work. Employee data enters every session, so it is collected for three stated purposes only. Agents get synthetic data only, such as Tenor test personas. That goes beyond RTS Art. 16(5), which allows anonymised, pseudonymised or randomised production data in non-production environments such as agent sandboxes.5 A scanner for national identity numbers (fødselsnummer and D-number) and data loss prevention (DLP) at Slack intake and at the model gateway catch real identifiers that slip in.
Employees are the harder case: prompts, steering and telemetry are personal data about named engineers. Norwegian law allows monitoring of employees' electronic equipment only to administer the network or to detect or clear up security breaches,36 and Datatilsynet adds that logging counts as monitoring even if nobody reads it, and that monitoring for any other purpose is unlawful.6
Datatilsynet's guidance in its own words, with translations 2 quotes
“Innsamling av opplysninger, for eksempel gjennom logging, er omfattet, selv om arbeidsgiveren ikke nødvendigvis går gjennom opplysningene.”
“Dersom overvåkingen skjer for andre formål, uansett hvor aktverdige disse er, vil den være ulovlig.”
Before any telemetry, the impact assessment and the consultation. The data protection officer (DPO) completes a data protection impact assessment (DPIA) that includes staff views, which is mandatory for systematic monitoring.6 The bank holds the drøfting (consultation) under arbeidsmiljøloven § 9-2 with the tillitsvalgte (employee representatives) “så tidlig som mulig” (as early as possible).37 Both come before any OpenTelemetry (OTel) export, transcript archive or witness content, pilot included; until then only the platform team uses the laptop lane (chapter 15).
Three purposes, nothing else.
- DORA change evidence.
- Security: detecting and investigating incidents.
- Operating the platform in aggregate, with a GDPR Art. 6(4) compatibility assessment.
Split transcripts, no individual scores. The agent side (tool calls, commands, files, versions) stays with the change record; human turns are encrypted with per-person keys and kept for less time. Line managers read no transcripts, and metrics are per PR, team or domain, never per person, with a minimum cell of five.
Who can read a session transcript, and how long the identity mapping lasts 6 rows
Triage of the worst sessions and mining for evals use agent-side extracts only. The identity mapping is kept for as long as the longest record that uses it, under dual control. Erasure is refused meanwhile, because the records serve a legal obligation (GDPR Art. 17(3)(b)).38
| Who | What | How |
|---|---|---|
| The requester | Their own sessions | Self-service |
| The approver | The session behind the change under review | During review only |
| Security | Sessions linked to a security event | Dual-control break-glass, logged |
| Internal audit | Sampled change records | Logged sampling |
| Line managers | Nothing | — |
| The platform team | Nothing by default | Aggregates with a minimum cell of 5 |
Deep dive: the two vendor data paths that managed settings close 1 min
Managed settings disable the /feedback command and the WebFetch domain check, which could send transcripts or hostnames to the vendor. /feedback is off by default on Bedrock, but a report it sends is kept by Anthropic for five years, so the command is disabled outright. The WebFetch domain safety check calls Anthropic whichever provider serves the model.39 Content logging stays off; OTel redacts prompts and tool content by default.40
{
"env": {
"DISABLE_FEEDBACK_COMMAND": "1" // no /feedback transcript uploads
},
"skipWebFetchPreflight": true // no hostname check sent to the vendor
// OTEL_LOG_USER_PROMPTS and OTEL_LOG_TOOL_CONTENT are never set: content stays redacted
}
Two need written legal opinions. Is a central transcript archive a “personlige område” (personal area) under FOR-2018-07-02-1108 § 1, which would bring the employer-access procedure into play?36 And does an LLM provider act “på vegne av” (on behalf of) the bank under hvitvaskingsloven § 28?35 Until the second is answered, AML case content reaches no model and no AML cell exists.
Evidence: integrity first, retention by purpose
Evidence must be impossible to alter quietly. How long it is kept is a risk decision the bank makes and writes down. RTS Art. 12(2) requires logs to be protected “against tampering, deletion, and unauthorised access” and logging failures to be detected, but leaves retention to the bank.5 No source sets a period for change records or requires write-once (WORM) storage (research reconciliation, item c54).
Integrity
- Keys that only a dual-controlled role can destroy.
- Locks that only dual-controlled evidence admins can bypass, and in compliance mode nobody can.41
- A replica in a separately administered account, restore-tested yearly.
- Self-verifying records that carry the notary's public key and the verifier version.
- Hash-chained manifests that alert on any break, written by a control plane that can append but never delete.
Deep dive: how each integrity control works 1 min
- Keys cannot be destroyed. A service control policy (SCP) denies deletion, disabling, policy changes and grants on the notary and governance-tier keys, except to a dual-controlled role, with CloudTrail alarms. The compliance tier uses S3-managed encryption, so no customer key can crypto-erase it (inference).
- Locks cannot be bypassed casually. In compliance mode nobody, not even the root user, can delete a locked object or shorten its lock. Governance mode allows a privileged bypass,41 and that permission is held only by evidence admins under dual control.
- The replica is also the bookkeeping backup. The Object Lock bucket in eu-central-1 is also the separate backup that bokføringsforskriften § 7-2 requires. Storing accounting material in another EEA state needs a notice to skattekontoret (the tax office) under § 7-5, and records must stay readable and printable from Norway.42
- Records verify themselves. Each record stores the notary's public key and the verifier version. Signing keys are retired by key policy, never deleted.
- Gaps are loud, and GitHub's own logs are short-lived. Manifests are hash-chained, with alerts on any break. GitHub keeps its enterprise audit log for 180 days and Git events for 7,43 so records are exported at merge and audit logs are streamed.
Retention follows purpose. Only ledger, posting and closing changes get a compliance-mode lock: five years after the last financial year the version ran, under bokføringsloven § 13.7 Other change records get a governance lock for five years (inference); proof media 12 months to 5 years by tier; pseudonymous OTel 13 months. A compliance lock cannot be shortened, even to honour a legitimate deletion, which is why it is used only where a statute sets a floor.
Retention schedule, record by record, with the statutory floors 9 rows
| Record | Legal basis | Lock mode | Period |
|---|---|---|---|
| Ledger, posting and closing changes | Bokføringsloven § 137 | Compliance | 5 years after the last financial year the version ran |
| Other change records, incl. security-parameter events (rulesets, CODEOWNERS, bypasses, managed settings) | RTS 12(2) policy; risk justification approved by ICT risk | Governance | 5 years (inference) |
| Emergency (TE) and incident-linked changes; incident evidence | RTS 22(d); 2024/1772 Art. 8(2)44 | Governance + legal hold | As the change; incident evidence no longer than necessary |
| Proof media (synthetic data) | RTS 12(2) | Governance | T2 5 years; T1 18 months; T0 12 months |
| Agent-side transcript; witness chain | With the change record | Governance | As the change; unmerged 90 days unless held |
| Human turns | GDPR 6(1)(f); DPIA | Governance, per-person key | Merged T2 24 months, T1 12; unmerged 90 days |
| OTel (pseudonymous) | Third purpose (aggregate operation) | — | 13 months |
| Other GitHub audit events; check exports | RTS 12(2) | Governance | 3 years |
| Identity mapping | GDPR 6(1)(c) | Dual-control database | As long as the longest record that references it |
Runs and changes linked to a security event or incident get a legal hold automatically. Slack is not a record; messages are kept for 12 months.
What the audit pack contains, and how auditors sample it 7 items
The second line samples 10-20 PRs a month, and internal audit walks one change end to end in month 4 (chapter 09 shows the change record). The pack holds:
- the role model and change classes;
- the generated policy, with its history;
- the CIF assessments and clause maps;
- probe, bypass and injection results;
- the SoD report and attestations;
- the daily reconciliation of merges and deployments against notarised records;
- drill reports, and spike decisions filed as ICT changes.
Incidents: classified before they happen
An agent-platform section in the bank's ICT incident procedure means nobody has to decide under pressure whether a canary leak or a broken chain is reportable. Five events get a pre-filled classification against Regulation 2024/1772, whose criteria include data losses (covering source-code confidentiality) and critical services affected:44 injection exfiltration, a model-vendor data incident, evidence tampering or a logging gap, an SoD or ruleset bypass, and a compromised broker, notary or gateway key.
The five events and what each threatens 5 rows
Source-code confidentiality matters to supervisors: the ESAs list “protect confidentiality of source code” among their mitigations for frontier-AI risk.46
| Event | What it threatens |
|---|---|
| Injection exfiltration | Confidentiality of source code or secrets (data loss) |
| A model-vendor data incident | Confidentiality at a third party; vendor assistance terms apply |
| Evidence tampering or a logging gap | Integrity and completeness of change records |
| An SoD or ruleset bypass | Independent approval of changes to critical systems |
| A compromised broker, notary or gateway key | Authenticity of every record signed or published with it |
- One alert path. Platform alerts, from a silent bot to notary or chain mismatches, go to the security operations centre (SOC) and its security information and event management (SIEM) system; chapter 13 lists them.
- Named clock holders. The chief information security officer (CISO) holds the DORA major-incident reporting clocks (Art. 19);3 the DPO holds the GDPR 72-hour clock. The plan assumes 4 hours, 24 hours and one month; ICT risk confirms the exact deadlines, including the intermediate report, in the Art. 20 reporting standards, which this research did not re-check.
- Vendors are on the hook. Vendor contacts and the Art. 30(2)(f) incident-assistance terms are part of the clause map.3
- Incidents link back to changes. Incident tickets carry change and run IDs, exported into the change record, and incident evidence is kept as RTS Art. 22 requires.5 A classification tabletop runs with the quarterly drills.
Intellectual property: thin indemnities, so check provenance and keep records
Vendor indemnities are thin for agent-written code, so the protection is a provenance check in CI and good records of human input. This is an engineering reading of published contracts, checked by its author but not by counsel: treat it as sharp questions for legal, not as advice.
- The cover is thin for agent code. Anthropic Ireland, which sells Claude on Bedrock, gives the IP defence,29 but it excludes claims arising from modified outputs or outputs combined with other technology,47 and agent code is always both. Indemnity is a tie-breaker, not a control.
- Generated code may not be protectable by copyright,4950 so the bank relies on trade secret and records the human design inputs.51
- Contamination is small but real: one preprint found 0.3-3.4% of filtered functions “functionally memorized” by four open models.52
- Some licences treat agents as users, which shaped tool choices such as Moby over Docker Desktop.54
Deep dive: the contract wording, copyright law and the licence terms behind each point 1 min
Indemnity
The seller indemnifies, not the host. On Bedrock, Anthropic Ireland sells Claude and gives the IP defence; AWS's own output indemnity covers AWS products, not third-party models.2930
Anthropic excludes claims arising from “modifications made by Customer to … Outputs” and from “the combination of … Outputs with technology or content not provided by Anthropic”.47 Betas carry no indemnity, and liability for them is capped at the lesser of USD 1,000 or 12 months' fees,48 and the terms are not negotiable.32
Copyright and trade secret
Åndsverkloven protects “original og individuell skapende åndsinnsats” (original, individual creative effort).49 The European Parliament insists that content fully generated by AI that does not meet the established criteria for copyright protection “should remain ineligible”.50 Trade secret protection needs “rimelige tiltak” (reasonable measures).51
Contamination
The preprint found memorisation of a kind that text matching misses.52 A vendor survey found licence conflicts in 68% of 947 audited codebases, without showing that AI caused them.53
Licences that treat agents as users
- Docker's agreement says that for AI features “'User' shall mean a human or AI Agent”, hence Moby and no Docker Desktop.54
- JetBrains' Kotlin language server is “explicitly designed for human use”.55
- GitHub permits machine accounts, not bot accounts, hence GitHub Apps.56
- Slack's API terms constrain background scraping.57
- pstack is MIT-licensed.58
A required provenance check, a licence-snippet scan distinct from build provenance, blocks copyleft or unknown snippet matches of 10 or more lines, or 20% or more of a file (proposed thresholds with no published basis). Exceptions need an approver who is not the requester. The sca (software composition analysis) check covers dependency licences, and the software bill of materials (SBOM) goes into the manifest. The evidence pack records human design inputs, and contractor terms add an assignment of AI-assisted output.
The governance gate: what must be true by weeks 4 and 8
Gate W-gov has owners outside the platform team, and the platform cannot widen until they sign. Part 1 opens the laptop lane and OTel to all engineers. Part 2 allows pilot hosted runs on green T0 and T1 work once the deny and perimeter probes pass. If a date slips, the owner writes down why (chapter 17). Owners follow recommendation §1.4.
Part 1 · week 4
- DPIA completed, with staff viewsOwner: DPO
- § 9-2 drøfting held with employee representativesOwner: DPO
- Purposes fixed, with the Art. 6(4) compatibility assessmentOwner: DPO
- CIF assessment of the Bedrock routeOwner: ICT risk
- Clause map, Art. 28(4) assessment and signed risk acceptance for Anthropic on BedrockOwner: ICT risk with legal, under the management body's policy
- RoI rows for every provider in useOwner: ICT risk
- Laptop probe greenOwner: CISO (platform team supplies the evidence)
Part 2 · week 8
- Role model and change classes approvedOwner: management body
- CIF assessments of the other surfaces, recorded in the RoIOwner: ICT risk
- Azure OpenAI Data Zone EU signedOwner: legal
- Evidence and break-glass admins named outside the platform teamOwner: CISO
- Agent-platform section of the incident procedure in forceOwner: CISO