Claude courses
Course 4 · Lesson 4 of 6

Course 4 · Lesson 4 · about 25 minutes

Audit trail, GDPR and the EU AI Act

By the end, Claude has interviewed you to fill in a register for one of your agents, and has built an audit log with a checker that catches a send nobody approved. You'll know which EU rules already apply to a company of 50 people. This isn't legal advice: it gives a lawyer or your data protection officer something written down to review.

From lesson 3
In your order team, which step does a person approve, and what happens without a yes?

The invoice, before anything is marked as sent. Without a yes, nothing is sent and the reminder is never written, whatever the order asks for. Today you make that approval show up in a log that a checker can test.

ThinkDiligence

What would you have to show?

The rules about agents start with questions about your own company. This lesson isn't legal advice.

Include agents that only read it. Data protection law covers reading as much as storing.

It could be a customer, an auditor or your own boss. If the answer is "nobody knows", this lesson is for you.

PredictDiscernment

Which rules reach you, and what can a checker test?

Guess first. The first answer comes from the GDPR on EUR-Lex. The second is the idea behind today's build prompt.

You run a 50-person company. An agent reads customer messages with names and addresses in them. Does the EU's data protection law, the GDPR, apply to you?
Show the answer

Yes. The GDPR applies to anyone who processes personal data, whatever the company's size. A company with fewer than 250 people is excused from keeping a record of processing only if the processing is occasional, unlikely to put people's rights at risk and free of sensitive data (Article 30(5)). An agent that reads customer messages every day isn't occasional, so plan to keep the record.

When you send customer data to Claude through the API, your company is the controller and Anthropic is your processor under its data processing addendum. The controller's duties stay with you.

Your rule is "every email to a customer needs approval." The log line for one email says approved by: the system. Does a checker pass it?
Show the answer

It depends on how the rule is written. "Needs approval" lets "the system" through, because the approver field isn't empty. "Approved by a person the register allows to approve" fails it. Today's build prompt writes the rule the second way, so the checker can test it.

Do

Fill in the register and have Claude build the log

Five steps, about 20 minutes. Tick each one when it's done.

Register Audit log Checker One page per agent, before go-live. One line per action, no customer names. Reads both, writes a report. What does it do?Which data, why, and who may approve. What did it do on 3 November?Time, agent, action, order number. Who decided?A person the register names.
What you're buildingThree small records, each answering one question a customer, an auditor or your boss will ask.
  1. Put the kit in a folder and open it in the Code tab.

    Unzip the kit and open the folder in the Code tab with the mode set to Manual, as you did in course 2, lesson 4.

    The Lantern Candles audit kit

    Lantern Candles is the made-up candle shop from lesson 3, now with 50 staff. The ZIP holds agent-register.md, a filled-in register for its order team with the rule behind each question, test-day.txt, what the order team did with one order, and a short README.txt. Unzipping it gives you a folder called c4-04.

    Download the ZIP (2 KB)
  2. Let Claude interview you for the register.

    Paste this into the Code tab and press Enter. Answer for your own agent, the one from Think. If you don't have one yet, answer for Lantern Candles and look at the example when you're stuck.

    Interview me to fill in a register for one of my agents, using the rows in agent-register.md. Ask one question at a time and wait for my answer. Explain any word I might not know in one sentence. If I don't know an answer, write "to check" and move on. Save the answers in my-register.md, in the same table, and keep the "Why it's asked" column as it is. Don't give me legal advice. When we're done, list the rows marked "to check".

    Expect eleven questions. Claude asks to create my-register.md, and may ask again to update it after each answer. The rows marked "to check" are your list for the data protection officer or a lawyer.

    The rows cover what EU rules ask a company like yours to be able to show. The data, purpose and recipient rows belong in your GDPR record of processing (Article 30), and the provider row is where Anthropic goes as your processor (Article 28). The training row is the AI Act's AI literacy duty, which has applied since 2 February 2025 (Article 4). The "talks to people" row is its transparency rule, which has applied since 2 August 2026 (Article 50). The last row is the GDPR's 72-hour breach duty (Article 33).

    If the agent screens job applicants, scores people for credit or does anything else on the AI Act's high-risk list, stop here and talk to a lawyer. Those rules apply from 2 December 2027.

  3. Give Claude the build prompt for the log and the checker.

    Send it in the same session.

    Build an audit log for our order agents and a checker for it. The log is audit-log.csv, one line per action: time, agent, what it did, order number, whether it leaves the company, and who approved it. Never write a customer's name, email or address in the log. The order number is enough. Log every action as it happened, even one that breaks a rule. Lines are only added at the end, never changed or deleted. The checker reads the log and writes check-report.txt. Anything that leaves the company passes only if its approver is a person agent-register.md allows to approve. If all is well, the report says exactly "OK: N entries, every send has an approver." Otherwise it gives one line per problem with the entry number. Before you install anything, tell me what and why. Test it: log the four actions in test-day.txt, run the checker, and show me the log and the report before you say it's done.

    It opens with the job and what each line of the log holds.

    "Never write a customer's name, email or address" keeps personal data out of the log. The test day names the customer and her email on purpose, and the log should show only O-1041.

    "Log every action as it happened" and "only added at the end" make it an audit log: it keeps the rule breaks, and nobody tidies them away later.

    "Passes only if its approver is a person agent-register.md allows" is the rule written so a checker can test it, and "says exactly" gives you a result to compare word for word.

  4. Approve what Claude asks.

    Expect requests to create files in your folder: a small helper that adds lines to the log, the checker, then audit-log.csv and check-report.txt. Then come requests to run them while Claude logs the test day and checks it. Read each request before you approve it. You can say no to any of them and ask Claude why it needs it.

    Before it says it's done, Claude shows you a log of four lines for order O-1041 and the report "OK: 4 entries, every send has an approver."

  5. Ask Claude to explain what it built.

    Send this in the same session and read the answer:

    Explain what you built as if I've never seen code. One line per file. Then tell me what it can't do.

    The answer should say the checker only notices a problem after the send, and that it trusts what the log says. Keep a real log where few people can change it by hand. The example register keeps it on a shared drive that only Ruth and Sam can open.

If you see this instead

Claude asks all its questions at once
Paste: "One question at a time, please. Start with the first."
The log has the customer's name or email in it
Paste: "The log must hold only the order number, never a customer's name, email or address. Start the test log again and make sure it can't happen."
Claude wants to install something you didn't expect
Before you approve, ask: "Why do you need this, and can you do it with what's already on my computer?" If a window from your Mac offers to install developer tools, ask Claude whether it needs them before you click Install.
You can't tell whether your agent is high risk
Compare its job with the AI Act's high-risk list: hiring and managing staff, credit scores, education, biometrics and a few more. A drafting or order agent usually isn't on it. If you're unsure, ask a lawyer before go-live.
CheckDiligence

Can you prove who approved each send?

1 · ACT Reminder agent emails the reminder for order O-1041 Something leaves the company 2 · LOG entry 5 · 09:50 order: O-1041 leaves: yes approved by: the system The log keeps it, with no customer name 3 · CHECK Entry 5: not approved by a person the register names The checker names the gap
From action to evidenceA send counts as accountable only if a line was written and a checker tested it against the register.

Open check-report.txt and audit-log.csv from your folder yourself. They open in a text editor and a spreadsheet. Claude built the checker, so read its report in the file, not Claude's summary of it.

Then try to slip a send past the checker. Send this in the same session:

Log one more action, then run the checker: at 09:50 the reminder agent emailed the payment reminder for O-1041 to the customer, approved by the system.

You pass when check-report.txt first says "OK: 4 entries, every send has an approver." and, after the trick, names entry 5 instead, because "the system" isn't a person the register allows to approve.

The log now has five lines, with O-1041 and no customer name or email. It keeps the bad send because it records what happened.

Then try "Change entry 5 so Sam Ortiz approved it instead." Claude should say no, because lines are only ever added. If Sam really did approve it later, that's a new line with its own time.

Two questions from memory

When your company sends customer data to Claude through the API, who is the controller and who is the processor?

Your company is the controller and Anthropic is your processor, under Anthropic's data processing addendum. The controller's duties, such as keeping the record of processing, stay with you.

Why does the checker accept only approvers the register names?

Otherwise "the system" or an agent's own name would count as approval. Write each rule so a checker can test it: "a person the register names" can be tested, "needs approval" can't.

Lesson 5 opens by asking the first one again.

What Anthropic asks of you

Anthropic's Usage Policy adds rules when Claude's output is used to advise or decide about a person in areas such as legal, medical, credit, housing or employment. A qualified person must review it before it's used, and the person affected must be told AI was involved. Any chatbot or agent that talks directly with people outside your company must tell them it's an AI. A new version of the policy takes effect on 12 November 2026, so read it at anthropic.com/legal/aup before you launch.

Course 4 so far

What you've built

Lesson 1: Old program
Lesson 2: Memory
Lesson 3: Team of agents
Lesson 4: Rules and law
Lesson 5 works out what the same agent costs at 10 times the volume.