Skip to content

Conversation

@trend-anurag-das
Copy link

@trend-anurag-das trend-anurag-das commented Dec 16, 2025

Description

  • Trend Micro AI Application Security went GA on December 1, 2025.
  • In this PR, we are updating the AI Guard endpoint from beta to the officially released GA endpoint.
    • Added required header TMV1-Application-Name, which has the integrated application name.
    • Request key is changed from "guard" to "prompt" to match the API spec of the new endpoint.
    • Updated detailed AI Guard summary
  • Updated docs and example configs to reflect the same.

Previous PR with beta API integration for reference: #1355

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 16, 2025

Greptile Overview

Greptile Summary

Updates the Trend Micro Vision One AI Guard integration from the beta endpoint to the official v3.0 API endpoint (/v3.0/aiSecurity/applyGuardrails). Adds required application_name config field for the TMV1-Application-Name header and optional detailed_response field to control response verbosity via the Prefer header.

  • Updated default API endpoint from beta to v3.0 production endpoint
  • Added new required config field application_name with validation (max 64 chars, alphanumeric with hyphens/underscores)
  • Added optional detailed_response boolean to control Prefer header (return=representation vs return=minimal)
  • Changed request body field from guard to prompt to match new API schema
  • Updated documentation, examples, and tests with new endpoint and config options

Critical Issues:

  • actions.py references undefined class GuardrailRequest instead of existing Guard class - will cause NameError at runtime
  • Documentation contains invalid YAML syntax (Optional: detailed_response: true) that will cause parsing errors

Confidence Score: 1/5

  • This PR contains a critical bug that will cause a NameError at runtime, making it unsafe to merge.
  • Score of 1 reflects a critical undefined class reference (GuardrailRequest) that will cause runtime failures. Additionally, documentation contains invalid YAML syntax that will cause config parsing errors. These issues must be fixed before merging.
  • nemoguardrails/library/trend_micro/actions.py (critical: undefined class), docs/user-guides/community/trend-micro.md (invalid YAML syntax)

Important Files Changed

File Analysis

Filename Score Overview
nemoguardrails/library/trend_micro/actions.py 1/5 Critical bug: Uses undefined GuardrailRequest class instead of existing Guard class, causing NameError at runtime. Also updates request field from guard to prompt and adds new headers.
docs/user-guides/community/trend-micro.md 2/5 Documentation updates for new endpoint and config options, but contains invalid YAML syntax (Optional: detailed_response: true) that would cause parsing errors.
nemoguardrails/rails/llm/config.py 5/5 Adds application_name and detailed_response config fields to TrendMicroRailConfig and updates default URL to v3.0 endpoint.
tests/test_trend_ai_guard.py 4/5 Updates test configs with new endpoint URL and adds required application_name field. Tests will fail due to the NameError in actions.py.

Sequence Diagram

sequenceDiagram
    participant Client
    participant NeMoGuardrails
    participant TrendMicroAPI as Trend Micro AI Guard API

    Client->>NeMoGuardrails: Send message
    NeMoGuardrails->>NeMoGuardrails: Load TrendMicroRailConfig
    NeMoGuardrails->>NeMoGuardrails: Get API key from env var
    NeMoGuardrails->>NeMoGuardrails: Build request headers<br/>(Authorization, TMV1-Application-Name, Prefer)
    NeMoGuardrails->>TrendMicroAPI: POST /v3.0/aiSecurity/applyGuardrails<br/>{prompt: text}
    TrendMicroAPI-->>NeMoGuardrails: {action: "Block"|"Allow", reason: "..."}
    alt action == "Block"
        NeMoGuardrails-->>Client: "I'm sorry, I can't respond to that."
    else action == "Allow"
        NeMoGuardrails-->>Client: Continue with response
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (3)

  1. nemoguardrails/library/trend_micro/actions.py, line 115 (link)

    syntax: GuardrailRequest is undefined - will cause NameError at runtime. The Guard class should either be renamed to GuardrailRequest or this line should use Guard.

  2. docs/user-guides/community/trend-micro.md, line 26 (link)

    syntax: Invalid YAML syntax - Optional: prefix makes this a nested key, not a comment. Should be detailed_response: true with an optional comment marker.

  3. docs/user-guides/community/trend-micro.md, line 47 (link)

    syntax: Same invalid YAML syntax issue as above.

6 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@trend-anurag-das trend-anurag-das force-pushed the feature/official-trend-ai-guard branch from 00dd878 to e943d4c Compare December 16, 2025 10:18
@trend-anurag-das
Copy link
Author

Additional Comments (3)

  1. nemoguardrails/library/trend_micro/actions.py, line 115 (link)
    syntax: GuardrailRequest is undefined - will cause NameError at runtime. The Guard class should either be renamed to GuardrailRequest or this line should use Guard.
  2. docs/user-guides/community/trend-micro.md, line 26 (link)
    syntax: Invalid YAML syntax - Optional: prefix makes this a nested key, not a comment. Should be detailed_response: true with an optional comment marker.
  3. docs/user-guides/community/trend-micro.md, line 47 (link)
    syntax: Same invalid YAML syntax issue as above.

6 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant