# aws_auth

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_proxy_config/aws_auth)

Build a sandbox proxy rule that signs AWS HTTPS requests.

The sandbox proxy keeps the real AWS credentials outside the sandbox and
signs supported AWS requests with SigV4 on the sandbox's behalf.
Provide either ``role_arn`` or both static credentials, supplied as
``workspace_secret`` or ``opaque`` values. IAM-role support must be enabled
on the backend. LangSmith supplies the workspace External ID and renews
credentials; clients must not provide temporary credentials or External IDs.

In ``proxy_config``, a role uses its effective IAM permissions. In
``mount_config(auth=[...])``, it is restricted to the configured S3 mounts.
Role authentication is configured at sandbox creation, not through updates.

## Signature

```python
aws_auth(
    *,
    access_key_id: SandboxProxySecret | None = None,
    secret_access_key: SandboxProxySecret | None = None,
    role_arn: str | None = None,
    session_tags: Mapping[str, str] | None = None,
    name: str = 'aws',
    enabled: bool = True,
    env_vars: Mapping[str, str] | None = None,
) -> SandboxProxyRule
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_tags` | `Mapping[str, str] \| None` | No | AWS session tags for the role session, so the role's own policy can scope access per sandbox with ``${aws:PrincipalTag/<key>}`` (for example an S3 prefix per user). Requires ``role_arn``, and the role's trust policy must allow ``sts:TagSession``. Only valid in ``proxy_config``; a mount-scoped role in ``mount_config(auth=[...])`` cannot carry tags. (default: `None`) |
| `env_vars` | `Mapping[str, str] \| None` | No | Plaintext environment variables set for every command in the sandbox while this rule is enabled, for tools that refuse to run unless a credential variable is present even though the proxy injects the real credential on the wire. (default: `None`) |

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-python/blob/15dd2a789f976bbbafd803b26d0f25c08b5ed527/src/langsmith/sandbox/_proxy_config.py#L189)