# gcp_auth

> **Function** in `langsmith`

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

Build a sandbox proxy rule that injects GCP OAuth bearer auth.

The sandbox proxy keeps the service account JSON outside the sandbox and
injects OAuth bearer tokens for built-in Google API host matching.
``service_account_json`` must be supplied as a ``workspace_secret`` or
``opaque`` value; plaintext service account JSON is intentionally not
supported.

## Signature

```python
gcp_auth(
    *,
    service_account_json: SandboxProxySecret,
    scopes: Sequence[str] | None = None,
    name: str = 'gcp',
    enabled: bool = True,
    env_vars: Mapping[str, str] | None = None,
) -> SandboxProxyRule
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `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#L257)