UK AI Cyber Security Code of Practice for AI agents: what it asks you to log and prove
The UK's Code of Practice for the Cyber Security of AI is voluntary. It never mentions agents. It is still one of the most practical documents a team running AI agents can read, because several of its thirteen principles turn directly into things an agent run should leave behind. This piece covers

Posted on Nov 24 • Originally published at traceseal.io
The UK's Code of Practice for the Cyber Security of AI is voluntary. It never mentions agents. It is still one of the most practical documents a team running AI agents can read, because several of its thirteen principles turn directly into things an agent run should leave behind. This piece covers what the Code is, how its roles map onto an agent, which provisions matter most, and what the Code does not ask you to prove.
The Department for Science, Innovation and Technology published the Code on 31 January 2025, with a separate implementation guide. The Code describes itself as a "voluntary Code of Practice". It sets out thirteen principles across five phases of the lifecycle: secure design, development, deployment, maintenance and end of life.
Its wording is precise about strength. "Shall" "Indicates a requirement for the voluntary Code", and "should" "Indicates a recommendation for the voluntary Code". So a "shall" is not a legal duty, but it is the part you would be expected to meet if you claim to follow the Code.
The Code also asks to be read as "an addendum to the Software Code of Practice".
When the Code was published, the government said on the publication page that it would submit the Code and guide to ETSI, "where it will be used as the basis for a new global standard (TS 104 223)". ETSI has since gone further. On 14 January 2026 it announced EN 304 223, a European Standard "Reinforcing the principles introduced in ETSI TS 104 223", with the same thirteen principles and five phases. The press release does not mention the EU AI Act, and we make no claim here about the standard's status under it.
The Code is written for AI systems, including those built on deep neural networks such as generative AI. An agent built on a large language model is such a system, even though the word "agent" does not appear anywhere in the text.
The Code assigns provisions to roles rather than to products. Three matter most:
One organisation can hold several roles. A team that writes its own agent on top of a hosted model, and runs it against its own repositories, is usually both Developer and System Operator. That matters because the logging duty sits with the operator and the audit trail duty with the developer. If both are you, both are yours.
This is the closest the Code comes to describing tool use. It reads: "Where the AI system will be interacting with other systems or data sources, (be they internal or external), Developers and System Operators shall ensure that the permissions granted to the AI system on other systems are only provided as required for functionality and are risk assessed."
For an agent, "other systems" means its tools: the shell, the file system, a database, an issue tracker, a cloud account. Least privilege for an agent means scoping each of those, and keeping the risk assessment that justified the scope. Provision 6.3 adds that dedicated environments "shall be backed by technical controls to ensure separation and principle of least privilege". Our sandboxing guide covers how to do that for a coding agent.
Provision 2.3 says "Developers shall document and create an audit trail in relation to the AI system", and that this "shall include the operation, and lifecycle management of models, datasets and prompts incorporated into the system."
Provision 8.3 is a recommendation, but it fits agents closely: "Developers should ensure that they have an audit log of changes to system prompts or other model configuration (including prompts) that affect the underlying working of the systems."
An agent's behaviour depends heavily on its system prompt, tool list and model version, and those change often. An audit trail of code releases alone misses them.
Principle 12 is "Monitor your system's behaviour". Provision 12.1 is the one requirement in it: "System Operators shall log system and user actions to support security compliance, incident investigations, and vulnerability remediation."
Provision 12.2 recommends that operators "analyse their logs to ensure that AI models continue to produce desired outputs and to detect anomalies, security breaches, or unexpected behaviour over time". Provisions 12.3 and 12.4 recommend monitoring internal states and performance over time.
"System actions" is the phrase that matters for agents. A chatbot's main action is producing text. An agent's actions are tool calls, and those are where it can do damage.
Principle 4 is "Enable human responsibility for AI systems". Provision 4.3 is a requirement: where human oversight is a risk control, Developers and/or System Operators "shall design, develop, verify and maintain technical measures" to reduce risk through that oversight. If your safety case for an agent is "a person approves risky actions", the approval step is a control you have to build and check, not a habit.
The Code does not list log fields. Our reading, for an agent, is that a run should leave a record of:
Our audit trail piece goes into storage, retention and personal data in more detail.
How to read this: the Code asks whether you keep records. It does not ask whether anyone outside your organisation could trust them, and that second question is where most disputes end up.
The Code says logs must exist and what they are for. In the provisions we have quoted, it says nothing about protecting logs from alteration or about how a customer, auditor or insurer could check them independently. A log file the operator can quietly edit meets the wording of 12.1.
For a security baseline that is reasonable: logs for incident investigation are mostly read by the people who wrote them. It becomes a gap once records must settle a question between two parties, for example whether an agent touched a customer's data.
Signed receipts address the trust question. The Traceseal receipt specification defines a record of a run that holds SHA-256 hashes of inputs, outputs and the sandbox profile, signed with Ed25519, so that anyone can detect a change to the signed content without asking us.
The limits are stated in the specification, and they matter. A receipt is "an attestation by the operator, not a proof of execution". A dishonest operator could sign a receipt for a run that never happened. A receipt records what the operator says the sandbox was, not that the sandbox enforced it. Verification does not establish who owns the signing key. And short or guessable inputs can be recovered from their hashes, so receipts need reviewing before you share them.
A receipt also covers only what reached the signer. If tool calls bypass the recording path, you get a well-signed record of part of a run. Receipts make records tamper-evident. They do not make them complete, and they do not satisfy any provision of the Code by themselves. For why that still matters, see our primer on signed execution receipts.
If you also fall under the EU AI Act, our Article 12 piece covers its logging duties for high-risk systems.