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

# IdentityContext

> What a provider is told about the call it is resolving a principal for (§3.1).

`ctrlrun.IdentityContext` — class, defined at `src/ctrlrun/identity.py:35`

```python theme={null}
from ctrlrun import IdentityContext
```

```python theme={null}
class IdentityContext
    def __init__(action: str, environment: str, headers: Mapping[str, str] = (lambda: _NO_HEADERS)(), agent: str | None = None, user: str | None = None)
```

What a provider is told about the call it is resolving a principal for (§3.1).

`headers` carries **lowercased** header names, because HTTP field names are
case-insensitive and a provider that had to guess the casing would be one that sometimes
worked. It is empty in-process; the gateway fills it.

`agent` and `user` are what an active `context()` supplied. They are a **hint**, not an
identity: a provider may ignore them, and both providers here do. They are passed so a
custom provider can implement "look up the token for this agent" without a second channel.

## Next

* [Python API index](/reference/api/index).
* [Get started](/get-started/quickstart) · [Why](/why).


## Related topics

- [The Agent Control Standard](/ACS.md)
- [Architecture](/ARCHITECTURE.md)
- [Python API](/reference/api/index.md)
- [context](/reference/api/context.md)
- [IdentityProvider](/reference/api/IdentityProvider.md)
