All posts

Just-in-time access for autonomous agents on AWS

Autonomous agents that run with static AWS credentials can silently exfiltrate data or launch costly resources. Most teams hand a long‑lived IAM access key to a service account, store it in a configuration file or secret store, and let the agent use it whenever it needs to call the AWS API. This static approach is the antithesis of just-in-time access. The key often carries broad permissions – read, write, and even delete across many services – because the team does not want to manage fine‑gra

Free White Paper

Just-in-Time Access + AWS IAM Policies: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Autonomous agents that run with static AWS credentials can silently exfiltrate data or launch costly resources.

Most teams hand a long‑lived IAM access key to a service account, store it in a configuration file or secret store, and let the agent use it whenever it needs to call the AWS API. This static approach is the antithesis of just-in-time access.

The key often carries broad permissions – read, write, and even delete across many services – because the team does not want to manage fine‑grained policies for each script.

This approach creates a hidden blast radius. If the agent is compromised, the attacker inherits every permission baked into the key. Even without a breach, the organization lacks visibility into which commands the agent issued, when, and against which resource. No audit trail, no approval step, and no way to retroactively block a dangerous operation.

Moving to non‑human identities and least‑privilege IAM roles is a step forward. The agent now authenticates with a role that only permits the actions it needs for a specific job. However, the request still travels directly to the AWS service endpoint. There is no gate that can ask for a human approval before a destructive API call, no place to record the exact request for later replay, and no mechanism to mask sensitive fields in responses. The enforcement gap remains at the data path.

Why a data‑path gateway is required for just-in-time access

Just-in-time access means granting a permission only for the moment it is needed, and only after a policy check confirms the request is legitimate. To achieve this, the control point must sit where the request leaves the agent and before it reaches the AWS service. That location is the only place that can inspect the request, apply a policy, and either allow, deny, or route it for approval.

Without a gateway, the agent talks straight to the AWS API. The policy engine, if any, lives in the IAM service, which cannot enforce per‑request approval workflows or record the exact command line that triggered the call. The result is a gap where malicious or accidental actions can slip through unchecked.

Continue reading? Get the full guide.

Just-in-Time Access + AWS IAM Policies: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

How hoop.dev enforces just-in-time access for AWS

hoop.dev provides the missing data‑path layer. It runs as a Layer 7 gateway that proxies all AWS traffic from agents. The gateway holds the AWS credential – a static IAM role or key – and presents it to the service on behalf of the agent. Users and agents authenticate to hoop.dev with OIDC or SAML tokens, so the gateway can read group membership and other identity attributes.

When an agent initiates an AWS request, hoop.dev evaluates a just-in-time policy. If the policy requires approval, the request is paused and routed to an approver. Once approved, hoop.dev forwards the request using its own credential. If the request violates a rule – for example, attempting to delete an S3 bucket that is not in the approved list – hoop.dev blocks the command before it reaches AWS.

Because hoop.dev sits in the data path, it can also record every request and response. The session log includes the identity that initiated the call, the exact API operation, parameters, and the outcome. This log can be replayed later for forensic analysis or compliance reporting.

In addition to approval and blocking, hoop.dev can mask sensitive fields in responses. For instance, if an agent queries a DynamoDB table that contains personally identifiable information, hoop.dev can redact those fields in the response before they reach the agent, reducing exposure of data to only what is needed for the task.

Key enforcement outcomes delivered by hoop.dev

  • Just-in-time approval: Every privileged AWS operation can be gated behind a real‑time human decision.
  • Command‑level blocking: Dangerous API calls are stopped before they affect resources.
  • Session recording: Full request and response logs are stored for replay and audit.
  • Inline data masking: Sensitive response fields are redacted in real time.

These outcomes exist only because hoop.dev occupies the data path. The setup – OIDC identity, least‑privilege IAM role – decides who may start a request, but without hoop.dev the request would travel unchecked to AWS.

Getting started

To try this model, follow the getting‑started guide to deploy the gateway and register an AWS connection. The guide walks you through configuring OIDC authentication, defining just-in-time policies, and enabling session recording. For deeper insight into policy options and masking capabilities, explore the learn section of the documentation.

FAQ

Do I still need IAM policies on the underlying AWS resources?

Yes. hoop.dev uses its own credential to call AWS, so the IAM role attached to the gateway must have the minimal set of permissions required for the approved actions. This layered approach ensures that even if an agent compromises the gateway, the damage is limited by the role’s scope.

Can I use hoop.dev with multiple cloud providers?

hoop.dev supports a range of connectors, including databases, Kubernetes, SSH, and HTTP services. While this post focuses on AWS, the same just-in-time pattern applies to any supported target.

How does session replay work?

hoop.dev stores a chronological log of each request and response. The log can be streamed to an external storage backend or queried directly through the UI. Replay simply replays the recorded traffic against a test environment, allowing you to see exactly what the agent did.

Ready to see the code in action? Explore the open‑source repository on GitHub and start building a just‑in‑time access layer for your autonomous agents 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