Learning resourcesReviewed · E2B

E2B Workload Identity guide

E2B's Workload Identity guide helps developers connect sandbox workloads to external services using short-lived identity tokens, but it requires configuring trust and any exchanged AWS credentials can outlive the sandbox. It explains JavaScript, TypeScript and Python configuration, proxy-based token injection, token verification and AWS role federation.

Researched 23 Nov 2026

In short.

E2B's Workload Identity guide is for developers giving sandbox workloads access to external services, with the catch that external trust must be configured and AWS credentials can remain valid after the sandbox ends. It documents named, audience-scoped JWT-SVID tokens, HTTPS header injection outside the sandbox, project-restricted token verification and AWS role federation. The page states availability on E2B Cloud and support-enabled BYOC deployments. It supports a concrete understanding of configuration and security boundaries, but pricing, exact token lifetimes, required SDK versions and operational reliability are unknown. Nothing was executed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected page at [https://docs.e2b.dev/iam/workload-identity.md], including its Cloud and BYOC availability notice, configuration examples, certificate-trust prerequisite, proxy behavior, federation requirements, AWS credential-lifetime warning and token limits. Linked pages and live services are excluded. No examples or integrations were run; runtime behavior, performance and security effectiveness remain unverified.

The overview

identity

This is E2B's instructional page for Workload Identity at [https://docs.e2b.dev/iam/workload-identity.md]. It explains how sandbox executions can identify themselves to external services using short-lived tokens instead of long-lived cloud credentials.

The page includes JavaScript, TypeScript and Python examples, external verifier requirements and an AWS IAM setup walkthrough.

assessment

The guide is useful when an application already uses E2B sandboxes and needs authenticated access to a trusted API or AWS resources. It explains both how credentials reach outgoing requests and how the receiving system should restrict which workloads it trusts.

Its main operational catch is that short-lived E2B identity does not determine the lifetime of credentials obtained from AWS. The page explicitly warns that those credentials remain valid after the identity token expires or the sandbox ends. Configuration behavior, reliability and security effectiveness have not been tested.

users

The audience includes application developers configuring E2B sandboxes, platform engineers managing outbound access and administrators responsible for AWS IAM or an external token verifier.

Beginners get examples in two SDK languages, but implementation requires understanding HTTP headers, certificate trust and permissions. Experienced developers get details about signing algorithms, token claims, execution identity and BYOC trust domains.

capabilities

A sandbox can register named tokens for particular audiences and reference them in per-host outbound request transforms. Header values can combine token placeholders, static text and stored-secret markers; the proxy substitutes each header atomically.

Forked sandboxes inherit token definitions but receive identities containing their own sandbox ID and a fresh execution ID. The guide also documents exchanging an AWS-audience token for temporary role credentials through AWS STS.

Using it

requirements

The configuration requires an E2B sandbox, SDK support for the documented options and a non-empty iam.tokens map. Each token needs an audience and the JWT-SVID token type. Minimum SDK versions are not stated. BYOC support requires enablement through E2B support.

A receiving verifier must use ES256 and check the expected iss, aud, exp and nbf claims, plus a sub belonging to the intended project. HTTP clients using their own CA bundle must trust the egress proxy. AWS federation additionally requires an OIDC identity provider and a role with suitable trust and permissions policies.

mechanism

The value exposed through iam.tokens.<name> is a placeholder, not a signed token. For matching HTTPS requests, the egress proxy replaces that placeholder with a valid token and adds the configured header. Sandbox code does not need to send a dummy header. Issuance and injection happen outside the sandbox, and the proxy may reuse a valid cached token for the same execution and audience.

Each token identifies a sandbox execution through a SPIFFE subject containing project, sandbox and execution IDs. E2B Cloud publishes discovery information at [https://id.e2b.dev/.well-known/openid-configuration]. BYOC deployments use their own issuer and signing keys, and their SPIFFE trust domain can differ from the issuer host.

setup

Pass iam when creating the sandbox and register tokens using Secret.iamToken in JavaScript or Secret.iam_token in Python. Plain token definitions are also supported. Configure a network rule whose transform places the named token placeholder in the required header. The example permits outbound traffic to registered hosts and denies other traffic.

For AWS, create an OIDC provider using [https://id.e2b.dev] and audience sts.amazonaws.com, then create a role allowing sts:AssumeRoleWithWebIdentity. Restrict its trust policy by audience and E2B project subject, attach permissions limited to the required actions and resources, and choose the shortest role session duration that fits the workload. BYOC requires deployment-specific issuer and trust-domain values.

example

The page registers a token named aws with audience sts.amazonaws.com and configures an outbound rule for an illustrative internal API. The proxy inserts the token into an Authorization header with the Bearer prefix when forwarding a matching request.

An external system receiving the token can exchange it through AWS STS using a role ARN, session name and web identity token. The response contains temporary role credentials. The page provides separate configuration and exchange examples; it does not implement the receiving service, and none of the examples was executed.

Assessment & evidence

limitations

A sandbox supports at most five workload tokens; exceeding that limit produces a 400 error at creation. JWT-SVID is the only supported token type. Omitting iam or supplying an empty tokens map leaves workload identity disabled.

Referencing an unregistered token name fails during creation with InvalidArgumentError in JavaScript or InvalidArgumentException in Python. Exact token lifetimes, refresh timing, revocation behavior, throughput and latency are not specified. The page does not document a method for sandbox code to read the raw JWT directly.

reasoning

The design gives each sandbox execution an identity that a trusted external system can accept without requiring long-lived cloud keys in the sandbox configuration. Proxy injection places token handling at the outbound network boundary.

Project-specific subject validation is essential: the page requires it to reject tokens issued for other E2B projects. Audience restrictions identify the intended verifier, while the AWS role's permissions determine which resources the resulting credentials can access. These are documented design properties, not independently demonstrated guarantees.

alternatives

The page contrasts workload identity with embedding cloud API keys in sandbox templates or passing them through environment variables. Those approaches distribute the long-lived credentials that this feature is intended to replace.

It provides no comparison with other workload-identity services or credential-management products. Relative cost, portability, setup effort and security across alternative products are not assessed.

evidence

The evidence is the complete selected E2B documentation page at [https://docs.e2b.dev/iam/workload-identity.md]. It supplies SDK examples, explanations of proxy behavior, token-verification requirements, an AWS trust policy and an STS exchange command.

Linked networking, certificate, secrets, fork, discovery and AWS documentation were not assessed. No code was executed, and no live token, request transformation, AWS exchange or BYOC deployment was verified.

Access & freshness

costs

The page gives no pricing for Workload Identity, sandbox usage, BYOC enablement or external-service usage. Total cost and any incremental charge for identity tokens are unknown. General availability does not establish that the feature is free.

rights

The selected page does not state a licence for its documentation or example code, or provide service terms. Rights to reuse or redistribute the text and examples, and applicable commercial-use conditions, are unknown from this evidence.

freshness

As captured on 23 November 2026, the page states that Workload Identity is generally available on E2B Cloud and supported in BYOC deployments after enablement through support. It provides no publication date, last-update date or SDK version requirements. Changes after that capture are unknown.

actions

Before adopting the configuration, confirm SDK compatibility, current pricing and applicable terms. Establish the correct issuer, audience and project-specific subject restrictions, then configure the intended outbound host and certificate trust.

In a development environment, verify header injection, rejection of invalid or wrong-project tokens, outbound restrictions and the AWS exchange if needed. Check the resulting AWS credential lifetime separately from the sandbox lifetime. These are proposed validation steps; no results are available.

Evidence for this report

selected-page.txtselected · checked 2026-11-23