All posts

Audit logging for autonomous agents on Entra

If an autonomous agent can act on your infrastructure without a reliable audit trail, you have no way to detect misuse. Entra supplies OIDC or SAML tokens that let service accounts and AI‑driven bots authenticate as non‑human identities. Those tokens tell the system who is making a request, but they do not automatically produce audit logging of what the request does once the connection is established. In many teams the agent connects directly to a database, a Kubernetes cluster, or an SSH host,

Free White Paper

K8s Audit Logging + Single Sign-On (SSO): The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

If an autonomous agent can act on your infrastructure without a reliable audit trail, you have no way to detect misuse.

Entra supplies OIDC or SAML tokens that let service accounts and AI‑driven bots authenticate as non‑human identities. Those tokens tell the system who is making a request, but they do not automatically produce audit logging of what the request does once the connection is established. In many teams the agent connects directly to a database, a Kubernetes cluster, or an SSH host, and the only evidence left is the token issuance log – a far‑too‑thin picture for forensics, compliance, or rapid incident response.

Effective audit logging must capture several data points for every interaction: the identity that initiated the session, the exact timestamp of each command, the full request payload, the response returned by the target service, and any error codes. When an autonomous workflow modifies production data, these details become the only proof of intent and can be the difference between a quick rollback and a costly investigation.

Relying solely on Entra’s identity verification leaves a gap. The token validates who can start a connection, but it does not sit on the data path where commands travel. Without a gateway that inspects traffic, a malicious or buggy agent can execute commands, retrieve secrets, or exfiltrate data without any record beyond the initial authentication event.

Why audit logging matters for autonomous agents

Audit logging provides three core guarantees. First, it creates an immutable sequence of actions that can be replayed to understand exactly what changed. Second, it supplies the evidence auditors demand for standards that require per‑user activity records. Third, it enables real‑time alerts when suspicious patterns emerge, such as a service account issuing a bulk delete command.

Continue reading? Get the full guide.

K8s Audit Logging + Single Sign-On (SSO): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Setup: Entra identities as the source of truth

The starting point is the Entra‑issued token. This token defines who the request is and whether the agent is allowed to begin a session. By configuring least‑privilege scopes in Entra, you limit the resources each autonomous identity can reach. However, token validation alone does not enforce command‑level controls or generate logs.

The data path: inserting a gateway between identity and resource

hoop.dev acts as a layer‑7 gateway that sits directly in front of the target service. Every network flow from the agent to a database, Kubernetes cluster, SSH host, or HTTP API passes through this gateway. Because the gateway terminates the protocol, it can observe each request and response without the agent ever seeing the underlying credential.

Enforcement outcomes: hoop.dev delivers audit logging

hoop.dev records each session in real time. It captures the identity from the Entra token, timestamps every command, logs the full request payload, and stores the corresponding response. The recorded stream is written to a durable store that can be queried for forensic analysis or exported to SIEM pipelines. Because hoop.dev is the only component that sees the traffic, the audit logs are complete and cannot be tampered with by the agent.

In addition to raw logs, hoop.dev can replay a session to reproduce exactly what happened, which is invaluable for debugging complex autonomous workflows. The logs also feed into alerting rules that trigger when a service account attempts a high‑risk operation, giving you a chance to intervene before damage spreads.

Getting started with audit logging for Entra‑driven agents

Deploy the gateway using the provided Docker Compose quick‑start or a Kubernetes manifest. Register Entra as the OIDC provider so that the gateway can verify incoming tokens. Add the resources you want to protect – for example a PostgreSQL database or a Kubernetes cluster – and enable the audit logging feature in the gateway configuration. The official getting started guide walks you through each step, and the learn section explains how to query and export the audit records.

Once the gateway is in place, any autonomous agent that presents a valid Entra token will have its actions recorded automatically. You do not need to modify the agent’s code; the agent simply connects to the target through the gateway using its normal client tools.

FAQ

  • Do I need to change my existing service accounts? No. Existing accounts continue to work; you only need to point them at the gateway endpoint instead of the raw target.
  • Can I filter which commands are logged? The gateway logs every request by default. You can configure policy rules to exclude low‑risk queries, but for compliance you typically retain a complete record.
  • How long are the logs retained? Retention is controlled by the backend storage you configure. hoop.dev does not impose a hard limit; you decide the policy that matches your compliance needs.

Ready to see the full implementation? Explore the open‑source repository on GitHub and start securing your autonomous agents with reliable audit logging today.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts