Guide

How to keep an audit trail for an AI agent

An AI agent acts for people, so you need to know later what it did and why. This guide shows how to record each action with its target, status, and time, and how to answer the question 'what did the agent do about X'.

Jump to the steps

The problem

Your agent sends emails, creates tickets, and posts messages. When a person asks what happened, a chat transcript is not enough. You need a record of each action.

This guide is about keeping that record. It is not a compliance claim.

How it works in Harny

Every action the agent takes is recorded. An action record has a target (what was acted on), a status, and a time.

You read the record with the actions API. Use POST /v1/actions to create a record, GET /v1/actions to list them, and GET /v1/actions/export to export them.

If you turn on record_runs, Harny sends a short step summary of each run. It never sends the person's message or the answer text.

Each memory also keeps its sources, so you can trace a remembered fact back to the data it came from.

Step by step

  1. Create a record for each action with its target, status, and time: POST /v1/actions. The SDK also takes parameters and a correlation_id.
  2. Set record_runs=True in the agent config to get a step summary for each run.
  3. Read each memory's sources to see which data point it came from.
  4. List the recorded actions: GET /v1/actions.
  5. Export actions when you need a copy outside Harny: GET /v1/actions/export.
  6. Recall memory as of a date to see what the agent knew then: POST /v1/memory/recall with queryTimestamp.

What can go wrong

  • Some actions have no undo. For example, email.send cannot be undone, so the record is the only proof of what was sent.
  • Run summaries never hold the message or answer text. Do not expect them to show what the person asked.
  • A changed memory with the same id becomes a new revision, and the memories built on the old revision are deleted. A changed value with a newer timestamp becomes the current value, and the earlier value stays answerable by date.

Example: the Acme pilot

Nadia at Acme asked the agent to follow up on the Acme pilot. The agent sent a message on March 14 for user demo-user. The action record shows the target, the status, and the time.

When Nadia asks what the agent did about the Acme pilot, you list the recorded actions and read the record for that target.

Frequently asked questions

Is this a compliance record?

No. It is a record of agent actions.

Does the record include the message text?

No. Run summaries never include the person's message or the answer text.

Can I export the record?

Yes. Use GET /v1/actions/export to export the actions.

Go on. Get Harny.

The first 500 monthly-active end users are free for good. Create an app key and make your first call in minutes.