Skip to content

Coding agents

Coding agents send model requests to a provider on your behalf. By pointing the agent at AI Gateway instead of the provider, you observe and control that traffic without changing how you work.

Why route a coding agent through AI Gateway

Routing a coding agent through AI Gateway gives you:

  • Observability — view every request, token count, and latency in the dashboard.
  • Caching — return cached responses for repeated prompts.
  • Rate limiting — cap request volume with rate limiting.
  • Cost tracking — attribute spend across sessions and models.
  • Data Loss Prevention — scan prompts and responses for secrets, credentials, and other sensitive data with DLP.

Set up your agent

Follow the setup guide for your coding agent:

Protect sensitive code with DLP

Coding agents routinely send source code, configuration files, and snippets to model providers. That traffic can include API keys, customer data, or other sensitive material. Because AI Gateway sits between the agent and the provider, you can inspect and control it without changing the agent.

Data Loss Prevention (DLP) scans request and response bodies against detection profiles and either flags or blocks matches. Use it to catch secrets, credentials, or regulated data leaving (or returning to) the agent.

Verify it works

After you configure a tool, confirm that traffic reaches AI Gateway.

  1. Send a prompt from the coding agent.

  2. In the Cloudflare dashboard, go to the AI Gateway page.

    Go to AI Gateway
  3. Select your gateway, then select Logs. Confirm that the request appears with its model, token count, and latency.

For more information on logs, refer to Logging.