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

# check • AI Agent SDK

> check: Check authentication for a request.

# check

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AuthProtocol**](../classes/AuthProtocol) class in the [**protocols**](../modules/protocols) module.

Check authentication for a request.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def check(request: Any) -> Dict[str, Any]
```

## Parameters

<ParamField query="request" type="Any" required={true}>
  The request object to authenticate
</ParamField>

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  * success: bool - whether authentication succeeded
    * user\_id: Optional\[str] - authenticated user ID
    * role: Optional\[str] - user role/permissions
    * metadata: Dict\[str, Any] - additional auth context
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2136">
  `praisonaiagents/gateway/protocols.py` at line 2136
</Card>
