> ## 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.

# Null Gateway Trace Hook • AI Agent SDK

> NullGatewayTraceHook: Zero-cost no-op :class:`GatewayTraceHook` used when tracing is disabled.

# NullGatewayTraceHook

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Zero-cost no-op :class:`GatewayTraceHook` used when tracing is disabled.

Every stage call returns a lightweight, argument-ignoring null context
manager (one small allocation per call), so firing the seam adds negligible
overhead on the hot path. This is the default a gateway uses until an
exporter plugin (e.g. the OTel/OTLP plugin in `praisonai-plugins`) is
supplied.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph TD
    event["Event Trigger"] --> hook["Hook: NullGatewayTraceHook"]
    hook --> decision{"Decision"}
    decision -- "Allow" --> proc["Process"]
    decision -- "Deny" --> block["Block"]
    style hook fill:#189AB4,color:#fff
    style event fill:#8B0000,color:#fff
    style proc fill:#8B0000,color:#fff
    style block fill:#8B0000,color:#fff
```

## Methods

<CardGroup cols={2}>
  <Card title="stage()" icon="function" href="../functions/NullGatewayTraceHook-stage">
    Return a no-op context manager, ignoring all arguments.
  </Card>
</CardGroup>

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Hooks Concept" icon="anchor" href="/docs/docs/concepts/hooks" />

  <Card title="Hook Events" icon="bolt" href="/docs/docs/features/hook-events" />

  <Card title="Callbacks" icon="phone" href="/docs/docs/features/callbacks" />

  <Card title="Gateway Feature" icon="tower-broadcast" href="/docs/docs/features/gateway" />
</CardGroup>
