> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# set_auth_mode

> Set the active auth mode for this process.

Source: [src/cwsandbox/\_auth.py:64](https://github.com/coreweave/cwsandbox-client/blob/v0.22.0/src/cwsandbox/_auth.py#L64)

```python theme={"system"}
set_auth_mode(name: str, get_auth: Callable[[], AuthHeaders]) -> None
```

Set the active auth mode for this process.

The active mode replaces the built-in auth mode until it is reset.
Configuration is process-global and last-writer-wins.
The callback must return AuthHeaders or raise CWSandboxAuthenticationError.
