All posts

Session recording for autonomous agents on EKS

Imagine an autonomous workload that runs kubectl commands across an Amazon EKS cluster, and every single action is stored, searchable, and replayable. With full session recording, security teams can trace the exact API calls that created a namespace, see which pod was deleted, and reproduce the sequence in a sandbox for forensic analysis. Compliance officers receive a ready‑made audit trail that links each command to the identity that initiated it, and developers gain confidence that their bots

Free White Paper

SSH Session Recording + Single Sign-On (SSO): The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Imagine an autonomous workload that runs kubectl commands across an Amazon EKS cluster, and every single action is stored, searchable, and replayable. With full session recording, security teams can trace the exact API calls that created a namespace, see which pod was deleted, and reproduce the sequence in a sandbox for forensic analysis. Compliance officers receive a ready‑made audit trail that links each command to the identity that initiated it, and developers gain confidence that their bots are operating within defined guardrails.

Without a dedicated recording layer, those agents typically use static IAM credentials, connect directly to the cluster, and leave no trace beyond the cluster’s own audit logs, which are often noisy, incomplete, or inaccessible to non‑admin teams. The result is a blind spot: you know a change happened, but you cannot prove who, why, or how it was executed. In high‑stakes environments, financial services, health data platforms, or any regulated SaaS, this opacity can become a compliance failure or a root‑cause nightmare after a breach.

The root of the problem is threefold. First, the initial state: teams provision a shared service account, embed its key in CI pipelines, and let autonomous agents use it unchecked. Second, the partial fix: they may rotate the key periodically or enforce least‑privilege IAM policies, but the request still flows straight to the EKS API server, bypassing any real‑time inspection or logging beyond what the cluster emits. Third, the missing piece: an enforcement point that can observe, approve, mask, and permanently record every command before it reaches the target.

Why the data path matters for session recording

Setup components, OIDC identity providers, IAM roles, and service‑account bindings, determine who may start a connection. They are essential, but they do not enforce what happens once the request leaves the identity provider. The only place to enforce session recording is the data path that sits between the agent and the Kubernetes control plane.

When a gateway intercepts the traffic, it can apply policies in real time: it can block a dangerous "kubectl delete" before it reaches the API server, require a human approval for a privilege‑escalation request, and write a complete log of the command and its response. Those outcomes exist only because the gateway is the sole point where the request can be examined and acted upon.

Introducing hoop.dev as the enforcement gateway

hoop.dev provides the Layer 7 gateway that fulfills the missing data‑path requirement for EKS. The gateway runs an agent inside the same VPC as the cluster, assumes a dedicated IAM role that maps to a Kubernetes RBAC binding, and then proxies all kubectl, exec, and port‑forward sessions. Because the agent never exposes the underlying credentials to the user or the autonomous process, every interaction is forced through the gateway.

hoop.dev records each command, the full response payload, and the identity that initiated the session. The recorded stream is stored in a central audit store that can be queried for compliance reports or replayed in a sandbox environment. The gateway also supports just‑in‑time access, so a bot can be granted temporary rights that automatically expire, reducing the blast radius of a compromised credential.

Continue reading? Get the full guide.

SSH Session Recording + Single Sign-On (SSO): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Because the gateway sits in the data path, it can also apply inline masking to sensitive fields returned by the API, ensuring that logs do not leak secrets while still preserving enough context for debugging. All of these enforcement outcomes, recording, masking, approval, and revocation, are possible only because hoop.dev is the point of control.

How the architecture works for EKS

The flow begins with an OIDC identity provider (Okta, Azure AD, Google Workspace, etc.). A user or CI system obtains a JWT, which hoop.dev validates and extracts group membership. The gateway then assumes the pre‑configured EKS IAM role that is mapped to a Kubernetes ClusterRoleBinding. This role grants the exact permissions needed for the session.

When the autonomous agent initiates a kubectl command, the request travels to the hoop.dev gateway instead of directly to the EKS API endpoint. The gateway inspects the wire‑protocol payload, applies any configured guardrails, writes the command and response to the audit log, and finally forwards the request to the cluster. The cluster sees a request that originates from the assumed role, not the original service account, preserving the principle of least privilege.

Because the gateway is the sole proxy, any attempt to bypass the policy, such as sending raw HTTP to the API server, fails unless it goes through the agent. This guarantees that session recording cannot be disabled by a rogue script running inside the same network.

Getting started

To try this pattern, follow the getting‑started guide. The documentation walks you through deploying the gateway with Docker Compose or Kubernetes, configuring the EKS IAM role, and linking your OIDC provider. All of the policy definitions for recording and masking are expressed in the same declarative format, so you can version‑control them alongside your infrastructure code.

For deeper details on how hoop.dev implements guardrails, see the learn section. It explains the concepts of just‑in‑time access, inline masking, and replayable session logs without exposing any implementation specifics.

FAQ

Does session recording add latency to kubectl commands?

The gateway processes the request at the protocol layer, which adds only a few milliseconds of overhead. The trade‑off is a complete, immutable audit trail that is essential for compliance and incident response.

Can I disable recording for a specific low‑risk operation?

Recording is enforced at the gateway level, so it applies to every proxied request. You can narrow the scope of what is recorded by adjusting the policy to exclude harmless read‑only commands, but the default posture is to capture everything for maximum visibility.

How are recorded sessions stored and protected?

hoop.dev writes logs to a configurable backend that supports encryption at rest and access controls. The storage location is separate from the EKS cluster, ensuring that even if the cluster is compromised the audit data remains intact.

Ready to add reliable session recording to your autonomous EKS workloads? View the source and contribute on GitHub.

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