← Back to Pull requests

[DOCS-16406] Add AI Guard for coding agents docs #41440

Merged
manuel-alvarez-alvarez merged 1 files (226 lines) on Nov 12, 2026 20:09 UTC
View on GitHub
manuel-alvarez-alvarez manuel-alvarez-alvarez commented on Nov 05, 2026 19:07 UTC
Author

<!-- Note: Please remember to review the Datadog Documentation Contribution Guidelines if you have not yet done so. -->

What does this PR do? What is the motivation?

Fixes DOCS-16406

The AI Guard docs cover custom agents and mention that AI Guard for coding agents is in Preview, but they don't explain how to set it up. This PR adds a Coding Agents page to the AI Guard docs. It explains how AI Guard protects coding agents such as Claude Code, Codex, and Cursor through Trajectory hooks.

  • New page: /security/ai_guard/coding_agents/ (how it works, supported coding agents and features, prerequisites, installation, configuration options, verification, policy scope per coding agent, blocking, results, and how to disable). It links to the existing pages for permissions, keys, policy settings, retention filter, and data access instead of repeating them.

  • The page is private because AI Guard for coding agents is in Preview: it isn't in the side navigation, site search, or the sitemap, and no other page links to it.
  • Merge readiness

  • Ready for merge
  • AI assistance

    Claude Code researched the feature and drafted the page. A human reviews all content.

    For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR.

  • 🤖 New: Comment with /review to run an automated check that catches common issues before a Documentation team member reviews your PR.
  • Additional notes

    APPSEC-71612

    Diff: 226 lines (+226 / -0) across 1 files Reviewer: melamos Review duration: 10141m
    All Vouch review confidence checks passed
    Residual risk 0.10 = Change Risk (0.40) × (1 − Review Confidence (0.76)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 226 lines diff across 1 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.52 · 5 substantive comment(s)
    0.52
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    75%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.325
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    24 items
    github-actions[bot] github-actions[bot] commented on Nov 05, 2026 19:11 UTC
    Bot

    Preview links (active after the build_preview check completes)

    New or renamed files


  • https://docs-staging.datadoghq.com/manuel.alvarezalvarez/ai-guard-coding-agents-docs/security/ai_guard/coding_agents
  • janine-c janine-c commented on Nov 12, 2026 16:25 UTC
    Contributor

    Hey Manuel, thanks for submitting this! I've created DOCS-16406 so we can assign this to one of my teammates for a closer review 🙂

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on Nov 12, 2026 16:27 UTC
    Author

    Hey Manuel, thanks for submitting this! I've created DOCS-16406 so we can assign this to one of my teammates for a closer review 🙂

    Hello @janine-c, many thanks! my agent told me to create it but didn't had the time yet.

    janine-c janine-c commented on Nov 12, 2026 16:27 UTC
    Contributor

    No problem, we're always happy to help out! 😀

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.

    Docs shouldn't make product promises. 🙂

    - **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages.
    

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.

    The policies page and the Configure policies section below call this "sensitive data scanning," and since this feature doesn't redact anything, "redaction" could mislead readers. I also dropped the roadmap note.

    - **Sensitive data scanning**: Detects secrets, such as API keys and passwords, in coding agent sessions. AI Guard reports secrets, but doesn't block or redact them.
    

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:

    The [Privacy mode](#privacy-mode) section says the default is coding_agent, but this command installs with unredacted, which stores full prompts and tool content in Datadog. Is unredacted the recommended setting for the Preview? If so, readers should know what they're opting into:

    1. Run the Trajectory installer in observe mode. This command sets the [privacy mode](#privacy-mode) to `unredacted`, which stores the full prompts and tool content in Datadog:
    

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:

    Is --yes required to switch to enforce? If so, should the command in the [Turn on blocking](#turn-on-blocking) step include it?

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.

    The setup page refers to this tab without a link, and a hardcoded app.datadoghq.com link breaks for other Datadog sites. I have an open action item to explore pros and cons of hardcoded product links in docs. I'd prefer to leave them out until that's settled.

    1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard {{< ui >}}Investigate{{< /ui >}} tab.
    

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.
    +
    +## Configure policies {#configure-policies}
    +
    +Coding agents have their own AI Guard policies, separate from the policies for custom agents. Coding agent policies have the same [policy settings][8] as custom agent policies. Their scope is a coding agent, such as Claude Code or Codex, instead of a service and environment.
    +
    +To manage coding agent policies, select {{< ui >}}Coding Agents{{< /ui >}} on the AI Guard {{< ui >}}Policies{{< /ui >}} tab, then [edit or create a policy][9]. Policies range from least to most specific:
    +
    +1. Default policy, which applies to every coding agent
    +1. Policy for a specific coding agent
    +
    +When more than one policy matches a request, AI Guard applies the most specific one. Inheritance works the same as for custom agent policies. See [Policy scope and inheritance][10].
    +
    +For [tools policies][11], use the tool name that the coding agent uses, for example `Bash` for the shell tool in Claude Code. [Sensitive data scanning][12] is monitoring only. AI Guard reports findings, but Trajectory doesn't redact the data that the coding agent sends to the model.
    +
    +## Turn on blocking {#turn-on-blocking}
    +
    +After you review the results in observe mode and adjust your policies:
    +
    +1. In the coding agent policy, set {{< ui >}}Enforcement mode{{< /ui >}} to {{< ui >}}Block unsafe{{< /ui >}}. See [Edit or create a policy][9].
    +1. On each developer computer, set the [mode](#mode) to `enforce`.
    +
    +Trajectory handles blocked requests in each coding agent, so blocking doesn't require changes to the coding agents.
    +
    +## View results {#view-results}
    +
    +To view coding agent evaluations, go to the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab and filter on `@ai_guard.coding_agent:*`. To keep every evaluation, [create a retention filter for AI Guard spans][13]. To restrict who can view the evaluations, see [Limit access to AI Guard spans][14].

    To view coding agent evaluations, filter on `@ai_guard.coding_agent:*` on the AI Guard {{< ui >}}Investigate{{< /ui >}} tab. To keep every evaluation, [create a retention filter for AI Guard spans][13]. To restrict who can view the evaluations, see [Limit access to AI Guard spans][14].
    

    melamos melamos commented on code on Nov 12, 2026 18:23 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.
    +
    +## Configure policies {#configure-policies}
    +
    +Coding agents have their own AI Guard policies, separate from the policies for custom agents. Coding agent policies have the same [policy settings][8] as custom agent policies. Their scope is a coding agent, such as Claude Code or Codex, instead of a service and environment.
    +
    +To manage coding agent policies, select {{< ui >}}Coding Agents{{< /ui >}} on the AI Guard {{< ui >}}Policies{{< /ui >}} tab, then [edit or create a policy][9]. Policies range from least to most specific:
    +
    +1. Default policy, which applies to every coding agent
    +1. Policy for a specific coding agent
    +
    +When more than one policy matches a request, AI Guard applies the most specific one. Inheritance works the same as for custom agent policies. See [Policy scope and inheritance][10].
    +
    +For [tools policies][11], use the tool name that the coding agent uses, for example `Bash` for the shell tool in Claude Code. [Sensitive data scanning][12] is monitoring only. AI Guard reports findings, but Trajectory doesn't redact the data that the coding agent sends to the model.
    +
    +## Turn on blocking {#turn-on-blocking}
    +
    +After you review the results in observe mode and adjust your policies:
    +
    +1. In the coding agent policy, set {{< ui >}}Enforcement mode{{< /ui >}} to {{< ui >}}Block unsafe{{< /ui >}}. See [Edit or create a policy][9].
    +1. On each developer computer, set the [mode](#mode) to `enforce`.
    +
    +Trajectory handles blocked requests in each coding agent, so blocking doesn't require changes to the coding agents.
    +
    +## View results {#view-results}
    +
    +To view coding agent evaluations, go to the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab and filter on `@ai_guard.coding_agent:*`. To keep every evaluation, [create a retention filter for AI Guard spans][13]. To restrict who can view the evaluations, see [Limit access to AI Guard spans][14].
    +
    +## Disable AI Guard for coding agents {#disable}
    +
    +To turn off AI Guard and remove its hooks, run the following command with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect. Trajectory observability continues to work.
    +
    +```bash
    +trajectory plugins security disable --clients cc,codex,cursor --remove-hooks
    +```
    +
    +## Further reading
    +
    +{{< partial name="whats-next/whats-next.html" >}}
    +
    +[1]: https://github.com/datadog-labs/trajectory
    +[2]: /security/code_security/software_composition_analysis/supply_chain_firewall/
    +[3]: https://github.com/datadog-labs/trajectory/blob/main/docs/SUPPORTED-CLIENTS.md
    +[4]: /security/ai_guard/setup/#permissions
    +[5]: /security/ai_guard/setup/#create-keys
    +[6]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +[7]: https://app.datadoghq.com/security/ai-guard/

    If you take the two suggestions above, this reference is unused and can go. (Renumbering isn't required.)

    melamos melamos commented on code on Nov 12, 2026 18:52 UTC
    Code Review
    hugo/content/en/security/ai_guard/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents

    Can you move this page up a level, to hugo/content/en/security/ai_guard/coding_agents.md? Coding agents have their own install methods (installer, MDM, and without the installer), so I think they'll wind up organized as a separate setup track rather than another integration method alongside the SDK and HTTP API pages. Moving it now, while the page is private, potentially avoids a URL change later.

    melamos melamos requested changes on Nov 12, 2026 18:55 UTC
    Changes Requested Reviewer

    Thanks, Manuel! This reads well and fits in nicely with the new and rewritten AI Guard pages. I left a few suggestions and questions inline, including one about moving the page up a level while it's still private.

    Your PR description lists items to confirm before review. Are those confirmed now, or still open?

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on Nov 12, 2026 19:08 UTC
    Author

    Thanks, Manuel! This reads well and fits in nicely with the new and rewritten AI Guard pages. I left a few suggestions and questions inline, including one about moving the page up a level while it's still private.

    > Your PR description lists items to confirm before review. Are those confirmed now, or still open?

    Thanks for quick review Melissa!, yes they are solved so I removed the block from the description.

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:08 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.

    Yeah, you are right, we are so close to having it ready that just wanted to advertise it 😓

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:09 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.

    Thanks!, I'll update it once redaction is ready.

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:10 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:

    Yes, for the preview the unredacted form is the recommended shape so they can see the data in the UI

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:10 UTC
    Code Review
    hugo/content/en/security/ai_guard/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:

    Yes, updated the Turn on blocking step with it

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:10 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.

    Updated, thanks!

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:11 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.
    +
    +## Configure policies {#configure-policies}
    +
    +Coding agents have their own AI Guard policies, separate from the policies for custom agents. Coding agent policies have the same [policy settings][8] as custom agent policies. Their scope is a coding agent, such as Claude Code or Codex, instead of a service and environment.
    +
    +To manage coding agent policies, select {{< ui >}}Coding Agents{{< /ui >}} on the AI Guard {{< ui >}}Policies{{< /ui >}} tab, then [edit or create a policy][9]. Policies range from least to most specific:
    +
    +1. Default policy, which applies to every coding agent
    +1. Policy for a specific coding agent
    +
    +When more than one policy matches a request, AI Guard applies the most specific one. Inheritance works the same as for custom agent policies. See [Policy scope and inheritance][10].
    +
    +For [tools policies][11], use the tool name that the coding agent uses, for example `Bash` for the shell tool in Claude Code. [Sensitive data scanning][12] is monitoring only. AI Guard reports findings, but Trajectory doesn't redact the data that the coding agent sends to the model.
    +
    +## Turn on blocking {#turn-on-blocking}
    +
    +After you review the results in observe mode and adjust your policies:
    +
    +1. In the coding agent policy, set {{< ui >}}Enforcement mode{{< /ui >}} to {{< ui >}}Block unsafe{{< /ui >}}. See [Edit or create a policy][9].
    +1. On each developer computer, set the [mode](#mode) to `enforce`.
    +
    +Trajectory handles blocked requests in each coding agent, so blocking doesn't require changes to the coding agents.
    +
    +## View results {#view-results}
    +
    +To view coding agent evaluations, go to the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab and filter on `@ai_guard.coding_agent:*`. To keep every evaluation, [create a retention filter for AI Guard spans][13]. To restrict who can view the evaluations, see [Limit access to AI Guard spans][14].

    Updated, thanks!

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:11 UTC
    Code Review
    hugo/content/en/security/ai_guard/setup/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents
    +description: Protect coding agents such as Claude Code, Codex, and Cursor with AI Guard through Trajectory hooks.
    +private: true
    +further_reading:
    +- link: /security/ai_guard/setup/
    +  tag: Documentation
    +  text: Set Up AI Guard
    +- link: /security/ai_guard/policies/
    +  tag: Documentation
    +  text: Manage AI Guard Policies
    +- link: https://github.com/datadog-labs/trajectory
    +  tag: Source Code
    +  text: Trajectory
    +---
    +
    +{{< site-region region="gov,gov2" >}}
    +<div class="alert alert-danger">AI Guard isn't available in the {{< region-param key="dd_site_name" >}} site.</div>
    +{{< /site-region >}}
    +
    +{{< callout url="https://www.datadoghq.com/product-preview/coding-agent-security-guardrails/" header="false" >}}
    +AI Guard for coding agents is in Preview.
    +{{< /callout >}}
    +
    +AI Guard can protect the coding agents that developers run on their computers, such as Claude Code, Codex, and Cursor. AI Guard evaluates the prompts, tool calls, and tool results of each coding agent session in real time. It can block unsafe actions before they run.
    +
    +AI Guard treats the developer as trusted, and flags actions that don't match what the developer asked for. Examples include instructions hidden in files or web pages (indirect prompt injection), attempts to read or send credentials, destructive commands, and malicious package installations.
    +
    +## How AI Guard for coding agents works
    +
    +AI Guard for coding agents runs inside [Trajectory][1], an open source tool from Datadog that connects to coding agents through their hooks.
    +
    +1. Trajectory installs hooks in each coding agent that you select.
    +1. When the developer submits a prompt, or when the coding agent calls a tool or receives a tool result, the hook sends the recent conversation to AI Guard.
    +1. AI Guard evaluates the conversation using the settings in the applicable [policy](#configure-policies) and returns an `ALLOW` or `DENY` action, with the reason for it.
    +1. If blocking is turned on and the action is `DENY`, the hook stops the prompt or the tool call, and the developer sees the reason.
    +
    +A block on a tool result can't undo the tool call that produced it. The block stops the coding agent from using the result.
    +
    +Trajectory runs in observe mode, which records results without blocking, or in enforce mode, which can block actions. See the [Configuration options](#configuration-options) section.
    +
    +## Supported coding agents
    +
    +AI Guard supports these coding agents:
    +
    +- Claude Code
    +- Codex
    +- Cursor
    +- GitHub Copilot CLI
    +- Kiro CLI
    +
    +Kiro CLI can't stop a prompt. When AI Guard blocks a prompt, Kiro CLI instructs the model to refuse it.
    +
    +AI Guard for coding agents supports the platforms that Trajectory supports. For agent versions and platform requirements, see [Supported Clients][3] in the Trajectory documentation.
    +
    +## Supported features
    +
    +AI Guard provides the following protections for coding agents:
    +
    +- **Guardrails**: Checks each prompt and tool call for threats, such as prompt injection, credential theft, and destructive commands. AI Guard can block unsafe prompts and tool calls.
    +- **Supply chain protection**: Checks each package that a coding agent installs with [Supply Chain Firewall][2], and can block malicious packages. Protection for coding agent extensions, such as skills, is in development.
    +- **Sensitive data redaction**: Detects secrets, such as API keys and passwords, in coding agent sessions. This feature is monitoring only: AI Guard reports secrets, but doesn't block or redact them. Blocking secrets is in development.
    +
    +Guardrails and supply chain protection block actions only after you [turn on blocking](#turn-on-blocking).
    +
    +## Prerequisites
    +
    +AI Guard for coding agents doesn't use the Datadog Agent or the Datadog SDK. Trajectory sends evaluations to Datadog directly from each developer computer.
    +
    +1. Confirm you have the AI Guard [permissions][4].
    +1. [Create an API key and an application key][5]. In addition to the `ai_guard_evaluate` scope, add the `appsec_vm_read` scope to the application key. Without this scope, AI Guard skips supply chain protection.
    +
    +## Install and enable AI Guard for coding agents {#install}
    +
    +{{< tabs >}}
    +{{% tab "Individual developers" %}}
    +
    +1. Set your API key and application key in environment variables:
    +
    +   ```bash
    +   export DD_API_KEY=<YOUR_API_KEY>
    +   export DD_APP_KEY=<YOUR_APPLICATION_KEY>
    +   ```
    +
    +1. Run the Trajectory installer in observe mode, with the unredacted privacy mode:
    +
    +   ```bash
    +   bash <(curl -fsSL https://raw.githubusercontent.com/datadog-labs/trajectory/main/install.sh) --security-mode observe --security-privacy unredacted
    +   ```
    +
    +   When prompted, select your Datadog site. The installer stores both keys in the operating system keychain. Then it turns on AI Guard for each supported coding agent that it finds.
    +
    +1. Restart your coding agents.
    +
    +If you already use Trajectory, run the same command. The installer keeps your Trajectory configuration and adds AI Guard for coding agents.
    +
    +To set other options at installation time, see the [Configuration options](#configuration-options) section.
    +
    +{{% /tab %}}
    +{{% tab "Managed fleets (MDM)" %}}
    +
    +To deploy AI Guard with an MDM or UEM product, such as Jamf Pro or Microsoft Intune, follow the [Managed Endpoint Administrator Guide][1].
    +
    +[1]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +{{% /tab %}}
    +{{< /tabs >}}
    +
    +### Enable AI Guard without the installer
    +
    +To turn on AI Guard with your own tooling, such as a secrets vault, store both keys in the keychain and run the setup command:
    +
    +```bash
    +<COMMAND_THAT_PRINTS_YOUR_API_KEY> | trajectory config set-secret dd_api_key --stdin
    +<COMMAND_THAT_PRINTS_YOUR_APPLICATION_KEY> | trajectory config set-secret dd_app_key --stdin
    +trajectory plugins security setup --mode observe --clients cc,codex,cursor
    +```
    +
    +Replace the `--clients` value with the client IDs of the coding agents you want to protect:
    +
    +| Coding agent       | Client ID |
    +|--------------------|-----------|
    +| Claude Code        | `cc`      |
    +| Codex              | `codex`   |
    +| Cursor             | `cursor`  |
    +| GitHub Copilot CLI | `copilot` |
    +| Kiro CLI           | `kiro`    |
    +
    +## Configuration options {#configuration-options}
    +
    +You can set the following options when you run the installer, or change them later with the Trajectory CLI. For managed fleets, set them in your managed configuration. See the [Managed Endpoint Administrator Guide][6].
    +
    +### Mode {#mode}
    +
    +The mode controls whether AI Guard can block coding agent actions:
    +- `observe` (default): AI Guard evaluates each action and records the result, but doesn't block anything. Use this mode to review results and adjust your policies before you turn on blocking.
    +- `enforce`: AI Guard can block actions. Blocking also requires the policy enforcement mode to be {{< ui >}}Block unsafe{{< /ui >}}. See the [Turn on blocking](#turn-on-blocking) section.
    +
    +| When               | Flag or command                     |
    +|--------------------|-------------------------------------|
    +| At installation    | `--security-mode <MODE>`            |
    +| After installation | `trajectory plugins security setup` |
    +
    +To change the mode after installation, run the following command. Replace `<CLIENT_IDS>` with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect, and add `--yes` to confirm `enforce`:
    +
    +```bash
    +trajectory plugins security setup --mode <MODE> --clients <CLIENT_IDS>
    +```
    +
    +### Privacy mode {#privacy-mode}
    +
    +The privacy mode controls which content Trajectory stores in Datadog with each evaluation result:
    +- `coding_agent` (default): Trajectory removes message content, and keeps only metadata such as the action, the reason, and the attack categories.
    +- `unredacted`: Trajectory stores the full prompts and tool content.
    +
    +| When               | Flag or command                                  |
    +|--------------------|--------------------------------------------------|
    +| At installation    | `--security-privacy <PRIVACY_MODE>`              |
    +| After installation | `trajectory plugins modules evaluator configure` |
    +
    +To change the privacy mode after installation, run:
    +
    +```bash
    +trajectory plugins modules evaluator configure agent-security ai_guard --privacy-mode <PRIVACY_MODE>
    +```
    +
    +## Verify the installation {#verify}
    +
    +1. Run `trajectory plugins security status` to check that AI Guard is turned on, and in which mode.
    +1. Run `trajectory doctor` to check the Trajectory installation, including the keys. If Trajectory can't read the keys, evaluations fail and the coding agent continues without protection.
    +1. Start a session in a protected coding agent, then confirm that its evaluations appear on the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab.
    +
    +## Configure policies {#configure-policies}
    +
    +Coding agents have their own AI Guard policies, separate from the policies for custom agents. Coding agent policies have the same [policy settings][8] as custom agent policies. Their scope is a coding agent, such as Claude Code or Codex, instead of a service and environment.
    +
    +To manage coding agent policies, select {{< ui >}}Coding Agents{{< /ui >}} on the AI Guard {{< ui >}}Policies{{< /ui >}} tab, then [edit or create a policy][9]. Policies range from least to most specific:
    +
    +1. Default policy, which applies to every coding agent
    +1. Policy for a specific coding agent
    +
    +When more than one policy matches a request, AI Guard applies the most specific one. Inheritance works the same as for custom agent policies. See [Policy scope and inheritance][10].
    +
    +For [tools policies][11], use the tool name that the coding agent uses, for example `Bash` for the shell tool in Claude Code. [Sensitive data scanning][12] is monitoring only. AI Guard reports findings, but Trajectory doesn't redact the data that the coding agent sends to the model.
    +
    +## Turn on blocking {#turn-on-blocking}
    +
    +After you review the results in observe mode and adjust your policies:
    +
    +1. In the coding agent policy, set {{< ui >}}Enforcement mode{{< /ui >}} to {{< ui >}}Block unsafe{{< /ui >}}. See [Edit or create a policy][9].
    +1. On each developer computer, set the [mode](#mode) to `enforce`.
    +
    +Trajectory handles blocked requests in each coding agent, so blocking doesn't require changes to the coding agents.
    +
    +## View results {#view-results}
    +
    +To view coding agent evaluations, go to the AI Guard [{{< ui >}}Investigate{{< /ui >}}][7] tab and filter on `@ai_guard.coding_agent:*`. To keep every evaluation, [create a retention filter for AI Guard spans][13]. To restrict who can view the evaluations, see [Limit access to AI Guard spans][14].
    +
    +## Disable AI Guard for coding agents {#disable}
    +
    +To turn off AI Guard and remove its hooks, run the following command with the [client IDs](#enable-ai-guard-without-the-installer) of the coding agents you protect. Trajectory observability continues to work.
    +
    +```bash
    +trajectory plugins security disable --clients cc,codex,cursor --remove-hooks
    +```
    +
    +## Further reading
    +
    +{{< partial name="whats-next/whats-next.html" >}}
    +
    +[1]: https://github.com/datadog-labs/trajectory
    +[2]: /security/code_security/software_composition_analysis/supply_chain_firewall/
    +[3]: https://github.com/datadog-labs/trajectory/blob/main/docs/SUPPORTED-CLIENTS.md
    +[4]: /security/ai_guard/setup/#permissions
    +[5]: /security/ai_guard/setup/#create-keys
    +[6]: https://github.com/datadog-labs/trajectory/blob/main/docs/MANAGED-ENDPOINTS.md
    +[7]: https://app.datadoghq.com/security/ai-guard/

    It's gone, thanks!

    manuel-alvarez-alvarez manuel-alvarez-alvarez commented on code on Nov 12, 2026 19:11 UTC
    Code Review
    hugo/content/en/security/ai_guard/coding_agents.md:1
    @@ -0,0 +1,223 @@
    +---
    +title: Coding Agents

    Yes, ofc, it've moved it one level up.

    melamos melamos approved these changes on Nov 12, 2026 20:03 UTC
    Approved Reviewer

    Thanks for the fixes, @manuel-alvarez-alvarez ! You don't have Ready for merge checked, so I'll let you merge it when you're ready.

    Reviewers
    Assignees
    manuel-alvarez-alvarez manuel-alvarez-alvarez
    Labels
    risk: low confidence: 75.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 75.6% · Lower = rushed or shallow review
    75.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9.9% · Safe to merge
    9.9%