Skip to content

[New Plugin] Trend AI Guard#1453

Open
trend-willem-gooderham wants to merge 1 commit into
Portkey-AI:mainfrom
trend-willem-gooderham:feat/support_trend_ai_guard
Open

[New Plugin] Trend AI Guard#1453
trend-willem-gooderham wants to merge 1 commit into
Portkey-AI:mainfrom
trend-willem-gooderham:feat/support_trend_ai_guard

Conversation

@trend-willem-gooderham

Copy link
Copy Markdown

Description: (required)

  • Add Guardrail plugin support for Trend AI Application Security AI Guard feature
    Note AI App Sec will be GA Dec 1st and this PR can be merged after that date.

Tests Run/Test cases added: (required)

  • Added unit tests for guardrail functionality to trendai.test.ts

Type of Change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

@trend-willem-gooderham

Copy link
Copy Markdown
Author

Hello @VisargD, I have reached out to the Portkey Team via discord and I was told that I could ping you on this PR to help move it forward.

Thanks

@VisargD VisargD requested a review from Copilot December 17, 2025 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Trend AI Guard plugin that integrates Trend Micro's AI Application Security guardrail feature to scan LLM inputs and outputs for security threats and policy violations.

Key Changes:

  • New plugin implementation for Trend AI Guard with support for beforeRequestHook and afterRequestHook events
  • Comprehensive test coverage validating parameter requirements, API interactions, and threat detection logic
  • Plugin registration and configuration

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
plugins/trend-ai/version.ts Defines the plugin version as v1.0.0
plugins/trend-ai/trendai.test.ts Adds comprehensive unit tests covering validation, API integration, and threat detection scenarios
plugins/trend-ai/manifest.json Configures plugin metadata, credentials schema, and function parameters
plugins/trend-ai/guard.ts Implements the core guardrail handler with API integration and threat detection logic
plugins/index.ts Registers the new trend-ai plugin in the plugin registry
conf.json Adds trend-ai to the list of enabled plugins

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"description": "Trend AI Guard URL (e.g., https://api.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails)"
}
},
"required": ["v1Url", "apiKey"]

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

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

The required field references 'apiKey', but the credentials schema defines 'v1ApiKey'. These names should match for proper validation.

Suggested change
"required": ["v1Url", "apiKey"]
"required": ["v1Url", "v1ApiKey"]

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +47
},
"required": ["applicationName"]
}

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

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

The 'required' array is incorrectly nested inside the 'parameters' object. It should be placed at the same level as 'parameters', not inside it, to properly indicate which parameters are required for the function.

Suggested change
},
"required": ["applicationName"]
}
}
},
"required": ["applicationName"]

Copilot uses AI. Check for mistakes.
Comment thread plugins/index.ts
scan: f5GuardrailsScan,
},
'trend-ai': {
guard: trendAiGuard,

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

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

The function name 'guard' doesn't match the function ID 'aiGuard' defined in the manifest. For consistency, these should match.

Suggested change
guard: trendAiGuard,
aiGuard: trendAiGuard,

Copilot uses AI. Check for mistakes.
@VisargD

VisargD commented Dec 22, 2025

Copy link
Copy Markdown
Collaborator

Hi @trend-willem-gooderham , can you please share the latest API docs for Trend AI guard?

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.

3 participants