Repository: Portkey-AI/gateway
Pull request #1088: Add panw-prisma-airs plugin with tests and update config/index
Author: login: jroberts2600
Created: 2025-05-08T19:41:35Z | Merged: 2025-05-20T14:42:32Z

## Description
Integration with Palo Alto Networks Prisma AIRS API Intercept 

## Motivation
Support integration

## Type of Change
<!-- Put an 'x' in the boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] 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)

## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Unit Tests
- [x] Integration Tests
- [x] Manual Testing

## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->

## Checklist
<!-- Put an 'x' in the boxes that apply -->
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Related Issues
N/A


Diff:
diff --git a/conf.json b/conf.json
index 74d503797..e53e49bb4 100644
--- a/conf.json
+++ b/conf.json
@@ -7,7 +7,8 @@
     "pillar",
     "patronus",
     "pangea",
-    "promptsecurity"
+    "promptsecurity",
+    "panw-prisma-airs"
   ],
   "credentials": {
     "portkey": {
diff --git a/plugins/index.ts b/plugins/index.ts
index cb401f943..85b89c7c7 100644
--- a/plugins/index.ts
+++ b/plugins/index.ts
@@ -46,6 +46,7 @@ import { handler as azurePii } from './azure/pii';
 import { handler as azureContentSafety } from './azure/contentSafety';
 import { handler as promptSecurityProtectPrompt } from './promptsecurity/protectPrompt';
 import { handler as promptSecurityProtectResponse } from './promptsecurity/protectResponse';
+import { handler as panwPrismaAirsintercept } from './panw-prisma-airs/intercept';
 import { handler as defaultjwt } from './default/jwt';
 
 export const plugins = {
@@ -128,4 +129,7 @@ export const plugins = {
     protectPrompt: promptSecurityProtectPrompt,
     protectResponse: promptSecurityProtectResponse,
   },
+  'panw-prisma-airs': {
+    intercept: panwPrismaAirsintercept,
+  },
 };
diff --git a/plugins/panw-prisma-airs/intercept.ts b/plugins/panw-prisma-airs/intercept.ts
new file mode 100644
index 000000000..34e72a9fd
--- /dev/null
+++ b/plugins/panw-prisma-airs/intercept.ts
@@ -0,0 +1,68 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (params.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = true;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id:
+        typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function'
+          ? crypto.randomUUID()
+          : Math.random().toString(36).substring(2) + Date.now().toString(36),
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+
+    if (!res || typeof res.action !== 'string') {
+      throw new Error('Malformed AIRS response');
+    }
+    if (res.action === 'block') {
+      verdict = false;
+    }
+    data = res;
+  } catch (e: any) {
+    error = e;
+    verdict = false;
+  }
+
+  return { verdict, data, error };
+};
diff --git a/plugins/panw-prisma-airs/manifest.json b/plugins/panw-prisma-airs/manifest.json
new file mode 100644
index 000000000..848b496e1
--- /dev/null
+++ b/plugins/panw-prisma-airs/manifest.json
@@ -0,0 +1,30 @@
+{
+  "id": "panwPrismaAirs",
+  "name": "PANW Prisma AIRS Guardrail",
+  "description": "Blocks prompt/response when Palo Alto Networks Prisma AI Runtime Security returns action=block.",
+  "credentials": [
+    {
+      "id": "AIRS_API_KEY",
+      "name": "AIRS API Key",
+      "type": "string",
+      "required": true
+    }
+  ],
+  "functions": [
+    {
+      "id": "intercept",
+      "name": "PANW Prisma AIRS Guardrail",
+      "type": "guardrail",
+      "supportedHooks": ["beforeRequestHook", "afterRequestHook"],
+      "parameters": {
+        "type": "object",
+        "properties": {
+          "profile_name": { "type": "string" },
+          "ai_model": { "type": "string" },
+          "app_user": { "type": "string" }
+        },
+        "required": ["profile_name"]
+      }
+    }
+  ]
+}
diff --git a/plugins/panw-prisma-airs/panw.airs.test.ts b/plugins/panw-prisma-airs/panw.airs.test.ts
new file mode 100644
index 000000000..ac078bfaa
--- /dev/null
+++ b/plugins/panw-prisma-airs/panw.airs.test.ts
@@ -0,0 +1,27 @@
+import { handler as panwPrismaAirsHandler } from './intercept';
+
+describe('PANW Prisma AIRS Guardrail', () => {
+  const mockContext = {
+    request: { text: 'This is a test prompt.' },
+    response: { text: 'This is a test response.' },
+  };
+
+  const params = {
+    credentials: { AIRS_API_KEY: 'dummy-key' },
+    profile_name: 'test-profile',
+    ai_model: 'gpt-unit-test',
+    app_user: 'unit-tester',
+    timeout: 3000,
+  };
+
+  it('should return a result object with verdict, data, and error', async () => {
+    const result = await panwPrismaAirsHandler(
+      mockContext,
+      params,
+      'beforeRequestHook'
+    );
+    expect(result).toHaveProperty('verdict');
+    expect(result).toHaveProperty('data');
+    expect(result).toHaveProperty('error');
+  });
+});


Reviews:
user: login: b4s36t4
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T13:31:18Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T19:20:12Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T19:21:05Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T19:23:47Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T19:24:09Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-13T19:24:55Z
user: login: b4s36t4
body: Look good, Just only one comment.
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-14T12:19:37Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-14T12:50:59Z
user: login: b4s36t4
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-14T13:10:47Z
user: login: narengogi
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-06-09T06:50:19Z
user: login: jroberts2600
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-06-09T14:42:36Z

Review comments:
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
path: plugins/panw-prisma-airs/intercept.ts
user: login: b4s36t4
body: hey, I think there's no `requestId` field for `ctx` object, maybe we you use `randomUUID` function to create a unique id. 
created_at: 2025-05-13T13:23:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
path: plugins/panw-prisma-airs/intercept.ts
user: login: b4s36t4
body: this should `params.credentials.AIRS_API_KEY`.
created_at: 2025-05-13T13:24:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
+
+    if (!res || typeof res.action !== 'string') {
+      throw new Error('Malformed AIRS response');
+    }
+
+    verdict = res.action !== 'block';
path: plugins/panw-prisma-airs/intercept.ts
user: login: b4s36t4
body: Ideally `verdict` should be `false` if the guardrail has found something, say if a guardrail found `PII` in the content the verdict should be of `false` else you can return it as `true`. I think here you're doing it differently, can we fix it please? let me know if you have questions on this.
created_at: 2025-05-13T13:27:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
+
+    if (!res || typeof res.action !== 'string') {
+      throw new Error('Malformed AIRS response');
+    }
+
+    verdict = res.action !== 'block';
+    data = res;
+  } catch (e: any) {
+    error = e;
+    verdict = false;
path: plugins/panw-prisma-airs/intercept.ts
user: login: b4s36t4
body: I'd say let `verdict` defaults to `true` if there's any guardrail action then only change it to the `false`.
created_at: 2025-05-13T13:27:40Z
author_association: CONTRIBUTOR
path: plugins/panw-prisma-airs/panw.airs.test.ts
user: login: b4s36t4
body: Hi, we follow simple unit tests which will only invoke the guardrail function directly without any jest mocks or so. it doesn't even need to start the gateway. Maybe take a look at the existing test cases with other providers like azure or so. I'd be happy to assist you if you have any questions.

We can connect over discord, `b4s36t4` is my username. 
created_at: 2025-05-13T13:30:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
path: plugins/panw-prisma-airs/intercept.ts
user: login: jroberts2600
body: ty!  I’ve updated the code to generate a unique tr_id
created_at: 2025-05-13T19:20:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
path: plugins/panw-prisma-airs/intercept.ts
user: login: jroberts2600
body: code is updated to reflect this now
created_at: 2025-05-13T19:21:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
+
+    if (!res || typeof res.action !== 'string') {
+      throw new Error('Malformed AIRS response');
+    }
+
+    verdict = res.action !== 'block';
path: plugins/panw-prisma-airs/intercept.ts
user: login: jroberts2600
body: The verdict logic now defaults to true and is set to false only if the Prisma AIRS API returns action: "block" or if there’s an error
created_at: 2025-05-13T19:23:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,65 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (ctx.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = false;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id: ctx.requestId,
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
+
+    if (!res || typeof res.action !== 'string') {
+      throw new Error('Malformed AIRS response');
+    }
+
+    verdict = res.action !== 'block';
+    data = res;
+  } catch (e: any) {
+    error = e;
+    verdict = false;
path: plugins/panw-prisma-airs/intercept.ts
user: login: jroberts2600
body: done and ty again
created_at: 2025-05-13T19:24:09Z
author_association: CONTRIBUTOR
path: plugins/panw-prisma-airs/panw.airs.test.ts
user: login: jroberts2600
body: I've refactored to match the style of the other plugins 
created_at: 2025-05-13T19:24:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,69 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (params.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = true;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id:
+        typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function'
+          ? crypto.randomUUID()
+          : Math.random().toString(36).substring(2) + Date.now().toString(36),
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
path: plugins/panw-prisma-airs/intercept.ts
user: login: b4s36t4
body: Can we remove this?
created_at: 2025-05-14T12:18:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,69 @@
+import {
+  HookEventType,
+  PluginContext,
+  PluginHandler,
+  PluginParameters,
+} from '../types';
+import { getText, post } from '../utils';
+
+const AIRS_URL =
+  'https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request';
+
+const fetchAIRS = async (payload: any, apiKey: string, timeout?: number) => {
+  const opts = {
+    headers: { 'x-pan-token': apiKey },
+  };
+  return post(AIRS_URL, payload, opts, timeout);
+};
+
+export const handler: PluginHandler = async (
+  ctx: PluginContext,
+  params: PluginParameters,
+  hook: HookEventType
+) => {
+  const apiKey =
+    (params.credentials?.AIRS_API_KEY as string | undefined) ||
+    process.env.AIRS_API_KEY ||
+    '';
+
+  let verdict = true;
+  let data: any = null;
+  let error: any = null;
+
+  try {
+    const text = getText(ctx, hook); // prompt or response
+
+    const payload = {
+      tr_id:
+        typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function'
+          ? crypto.randomUUID()
+          : Math.random().toString(36).substring(2) + Date.now().toString(36),
+      ai_profile: {
+        profile_name: params.profile_name ?? 'dev-block-all-profile',
+      },
+      metadata: {
+        ai_model: params.ai_model ?? 'unknown-model',
+        app_user: params.app_user ?? 'portkey-gateway',
+      },
+      contents: [
+        { [hook === 'beforeRequestHook' ? 'prompt' : 'response']: text },
+      ],
+    };
+
+    const res: any = await fetchAIRS(payload, apiKey, params.timeout);
+    console.log('AIRS API response:', res);
path: plugins/panw-prisma-airs/intercept.ts
user: login: jroberts2600
body: ty!  code is now updated to address this
created_at: 2025-05-14T12:50:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,30 @@
+{
+  "id": "panwPrismaAirs",
+  "name": "PANW Prisma AIRS Guardrail",
+  "description": "Blocks prompt/response when Palo Alto Networks Prisma AI Runtime Security returns action=block.",
+  "credentials": [
+    {
path: plugins/panw-prisma-airs/manifest.json
user: login: narengogi
body: adding a note here, this object is incorrectly formed
it should be a json schema object
created_at: 2025-06-09T06:50:19Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,30 @@
+{
+  "id": "panwPrismaAirs",
+  "name": "PANW Prisma AIRS Guardrail",
+  "description": "Blocks prompt/response when Palo Alto Networks Prisma AI Runtime Security returns action=block.",
+  "credentials": [
+    {
path: plugins/panw-prisma-airs/manifest.json
user: login: jroberts2600
body: Thank you for catching this!  I've opened PR #1128 to address it.  
created_at: 2025-06-09T14:42:36Z
author_association: CONTRIBUTOR

PR comments:
user: login: matterai-app[bot]
created_at: 2025-05-08T19:41:38Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-08T19:42:06Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-92%25-02b838) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
This PR adds a new plugin for Palo Alto Networks Prisma AI Runtime Security (AIRS) integration. The plugin provides a guardrail that can block prompts or responses based on security analysis from the AIRS API. The implementation includes the main intercept handler, manifest file, and comprehensive test coverage.

### 🔍 Impact of the Change
This addition enables users to leverage PANW Prisma AIRS security capabilities to scan and potentially block AI prompts and responses that might contain malicious content, PII, or other security concerns. The plugin works with both beforeRequestHook and afterRequestHook, allowing for security checks at both stages of the AI interaction.

### 📁 Total Files Changed
- Added 4 new files for the PANW Prisma AIRS plugin implementation
- Modified 2 configuration files to register the new plugin
- Total: 323 lines added, 43 lines removed

### 🧪 Test Added
1. **Unit Tests** (`panw.airs.unit.test.ts`): Comprehensive unit tests that mock the API interactions and test various scenarios including:
   - Successful API responses with 'allow' action
   - Successful API responses with 'block' action
   - Handling of malformed API responses
   - Error handling for API failures
   - Default parameter behavior
   - API key sourcing from different locations

2. **Integration Test** (`panw.airs.test.ts`): A test script that can be run against a local server to verify the plugin's behavior with real API calls, testing both input and output guardrails with various prompts.

### 🔒Security Vulnerabilities
No security vulnerabilities detected in the implementation. The plugin properly handles API keys through credentials or environment variables.

## Motivation
Integrate Palo Alto Networks Prisma AI Runtime Security (AIRS) as a guardrail option for enhanced security scanning of AI prompts and responses.

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?
- [x] Unit Tests
- [x] Integration Tests

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
    participant Client
    participant Portkey Gateway
    participant PANW Prisma AIRS Plugin
    participant AIRS API

    Client->>Portkey Gateway: Request with guardrail config
    Note over Client, Portkey Gateway: Config includes panw-prisma-airs.intercept
    
    alt beforeRequestHook
        Portkey Gateway->>PANW Prisma AIRS Plugin: intercept(ctx, params, 'beforeRequestHook')
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: getText(ctx, 'beforeRequestHook')
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: Prepare payload with prompt
        PANW Prisma AIRS Plugin->>AIRS API: POST /v1/scan/sync/request
        Note over PANW Prisma AIRS Plugin, AIRS API: Headers: x-pan-token: apiKey
        Note over PANW Prisma AIRS Plugin, AIRS API: Payload: tr_id, ai_profile, metadata, contents
        AIRS API->>PANW Prisma AIRS Plugin: Response with action (block/allow)
        PANW Prisma AIRS Plugin->>Portkey Gateway: Return verdict (true/false)
    end
    
    alt afterRequestHook
        Portkey Gateway->>PANW Prisma AIRS Plugin: intercept(ctx, params, 'afterRequestHook')
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: getText(ctx, 'afterRequestHook')
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: Prepare payload with response
        PANW Prisma AIRS Plugin->>AIRS API: POST /v1/scan/sync/request
        AIRS API->>PANW Prisma AIRS Plugin: Response with action (block/allow)
        PANW Prisma AIRS Plugin->>Portkey Gateway: Return verdict (true/false)
    end
    
    Portkey Gateway->>Client: Final response (blocked or allowed)
```

author_association: CONTRIBUTOR
user: login: b4s36t4
created_at: 2025-05-09T13:31:30Z
body: Hey, @jroberts2600. thanks for contribution. But your PR seems to be removing some of our existing plugin configuration, can you check again!?
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-09T15:06:54Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-09T15:07:16Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-92%25-02b838) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
This PR adds integration with Palo Alto Networks Prisma AIRS API for content scanning and security. The implementation includes:
- A new plugin `panw-prisma-airs` that can intercept both prompts and responses
- Configuration for the plugin in the main config file
- Comprehensive unit tests and integration tests

### 🔍 Impact of the Change
This change enables content scanning for security threats using PANW Prisma AIRS API. The plugin can be configured to block prompts or responses based on security policies defined in AIRS profiles. It supports both pre-request and post-request hooks for comprehensive security coverage.

### 📁 Total Files Changed
- 6 files changed with 314 additions and 1 deletion
- Added new plugin files: intercept.ts, manifest.json, and test files
- Updated configuration to include the new plugin

### 🧪 Test Added
- **Unit Tests**: Comprehensive unit tests in `panw.airs.unit.test.ts` covering various scenarios:
  - Testing successful API responses with both 'allow' and 'block' actions
  - Error handling for malformed API responses
  - Testing API failures and error handling
  - Testing default parameter behavior
  - Testing environment variable fallbacks for API keys
- **Integration Tests**: Added `panw.airs.test.ts` for testing the plugin with real API calls using sample prompts

### 🔒Security Vulnerabilities
No security vulnerabilities detected. The implementation properly handles API keys through credentials and environment variables.

## Motivation
Integration with Palo Alto Networks Prisma AIRS API provides enhanced security scanning for AI content, helping to detect and block potentially harmful prompts and responses.

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?
- [x] Unit Tests
- [x] Integration Tests

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
    participant Client
    participant Portkey as Portkey Gateway
    participant AIRS as PANW Prisma AIRS API
    
    Client->>Portkey: Request with prompt
    Note over Portkey: Intercept with panw-prisma-airs plugin
    
    alt beforeRequestHook
        Portkey->>AIRS: POST /v1/scan/sync/request
        Note right of Portkey: Payload: {
            tr_id: requestId,
            ai_profile: { profile_name },
            metadata: { ai_model, app_user },
            contents: [{ prompt: text }]
        }
        AIRS-->>Portkey: Response { action, details }
        alt action == "block"
            Portkey-->>Client: Block request
        else action != "block"
            Portkey->>LLM: Forward prompt to LLM
            LLM-->>Portkey: LLM Response
        end
    end
    
    alt afterRequestHook
        Portkey->>AIRS: POST /v1/scan/sync/request
        Note right of Portkey: Payload: {
            tr_id: requestId,
            ai_profile: { profile_name },
            metadata: { ai_model, app_user },
            contents: [{ response: text }]
        }
        AIRS-->>Portkey: Response { action, details }
        alt action == "block"
            Portkey-->>Client: Block response
        else action != "block"
            Portkey-->>Client: Forward LLM response
        end
    end
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-09T15:27:50Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-09T15:28:14Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-92%25-02b838) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
This PR adds a new plugin integration with Palo Alto Networks Prisma AIRS API for content scanning and security. The plugin provides guardrail functionality to block potentially harmful prompts or responses based on AIRS API verdicts.

### 🔍 Impact of the Change
The integration enables content security scanning for both prompts and responses through the PANW Prisma AIRS service. This adds an additional security layer to the platform by allowing the blocking of potentially harmful content before it reaches the LLM or is returned to the user.

### 📁 Total Files Changed
- Added 4 new files: intercept.ts, manifest.json, panw.airs.test.ts, panw.airs.unit.test.ts
- Modified 2 existing files: conf.json, plugins/index.ts
- Total: 6 files with 317 additions and 1 deletion

### 🧪 Test Added
1. **Unit Tests**: Comprehensive unit tests in `panw.airs.unit.test.ts` covering various scenarios:
   - Successful API responses with 'allow' action
   - Successful API responses with 'block' action
   - Handling of malformed API responses
   - Error handling for API failures
   - Default parameter behavior
   - API key retrieval from different sources

2. **Integration Tests**: Basic integration tests in `panw.airs.test.ts` that test the plugin with real prompts against the API.

### 🔒Security Vulnerabilities
No security vulnerabilities detected in the implementation. The plugin properly handles API keys and implements appropriate error handling.

## Motivation
Integration with Palo Alto Networks Prisma AIRS API provides enhanced security capabilities for content filtering and protection against harmful prompts and responses.

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?
- [x] Unit Tests
- [x] Integration Tests

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
    participant Client
    participant Portkey Gateway
    participant PANW Prisma AIRS Plugin
    participant AIRS API

    Client->>Portkey Gateway: Request with prompt
    Note over Portkey Gateway: Configure guardrails with panw-prisma-airs.intercept
    Portkey Gateway->>PANW Prisma AIRS Plugin: beforeRequestHook(ctx, params)
    PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: getText(ctx, 'beforeRequestHook')
    PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: Prepare payload with prompt
    PANW Prisma AIRS Plugin->>AIRS API: POST /v1/scan/sync/request
    Note over AIRS API: Scan prompt with profile_name
    AIRS API-->>PANW Prisma AIRS Plugin: Response with action (allow/block)
    PANW Prisma AIRS Plugin-->>Portkey Gateway: Return verdict (true/false)
    
    alt verdict is true
        Portkey Gateway->>LLM Provider: Forward prompt
        LLM Provider-->>Portkey Gateway: Response
        Portkey Gateway->>PANW Prisma AIRS Plugin: afterRequestHook(ctx, params)
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: getText(ctx, 'afterRequestHook')
        PANW Prisma AIRS Plugin->>PANW Prisma AIRS Plugin: Prepare payload with response
        PANW Prisma AIRS Plugin->>AIRS API: POST /v1/scan/sync/request
        AIRS API-->>PANW Prisma AIRS Plugin: Response with action (allow/block)
        PANW Prisma AIRS Plugin-->>Portkey Gateway: Return verdict (true/false)
        
        alt verdict is true
            Portkey Gateway-->>Client: Return LLM response
        else verdict is false
            Portkey Gateway-->>Client: Block response
        end
    else verdict is false
        Portkey Gateway-->>Client: Block prompt
    end
```

author_association: CONTRIBUTOR
user: login: jroberts2600
created_at: 2025-05-09T18:37:12Z
body: 



> Hey, @jroberts2600. thanks for contribution. But your PR seems to be removing some of our existing plugin configuration, can you check again!?

Thanks for letting me know! I’ve reviewed and fixed the issue.  The plugin configuration should now be correct.  


author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-12T14:27:34Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-12T14:27:44Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-75%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added Palo Alto Networks Prisma AIRS Plugin
- Integrated new API intercept functionality

### 🔍 Impact of the Change
- Enables integration with Prisma AIRS API
- Provides new intercepting capabilities

### 📁 Total Files Changed
- Configuration files updated
- New plugin implementation

### 🧪 Test Added
- Unit tests for plugin functionality
- API connection tests
- Intercept data retrieval tests

### 🔒 Security Vulnerabilities
- Potential API authentication risks
- Recommended secure token management

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code
- [x] I have added tests that prove my feature works

## Sequence Diagram

```mermaid
sequenceDiagram
participant PaloAltoNetworks as PAN
participant PrismaAIRS as AIRS
participant Plugin as Plugin

PAN->>AIRS: Initialize API Connection
AIRS-->>Plugin: Authenticate
Plugin->>AIRS: Fetch Intercept Data
AIRS-->>Plugin: Return Intercept Results
```

author_association: CONTRIBUTOR
user: login: b4s36t4
created_at: 2025-05-13T13:32:30Z
body: Also, if it's possible can you share the documentation of the integration, will take a look at the docs maybe we can optimize the integration.
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-13T16:09:27Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-13T16:09:46Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-85%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added PANW Prisma AIRS plugin for AI security guardrails
- Implemented intercept mechanism for prompt/response validation
- Created manifest and test files for the plugin

### 🔍 Impact of the Change
- Enables AI security checks via Palo Alto Networks Prisma AIRS API
- Provides guardrail functionality for blocking potentially harmful AI interactions

### 📁 Total Files Changed
- 3 files added: 
  1. intercept.ts
  2. manifest.json
  3. panw.airs.test.ts

### 🧪 Test Added
- Unit test for PANW Prisma AIRS Guardrail
- Validates handler returns correct result object
- Checks verdict, data, and error properties

### 🔒 Security Vulnerabilities
- No immediate security vulnerabilities detected
- API key management implemented
- Supports environment and credential-based configuration

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## Checklist
- [x] Code follows project style guidelines
- [x] Self-review performed
- [x] Code commented in complex areas
- [x] Corresponding documentation updated
- [x] No new warnings generated
- [x] Tests added to prove feature works
- [x] All unit tests pass locally

## Sequence Diagram

```mermaid
sequenceDiagram
participant Client
participant PanwPrismaAirsPlugin as Plugin
participant AirsAPI as API

Client->>Plugin: Invoke handler(ctx, params, hook)
Plugin->>Plugin: Extract API Key
Plugin->>Plugin: Prepare payload
Plugin->>API: POST /v1/scan/sync/request
API-->>Plugin: Return scan response
Plugin->>Plugin: Evaluate response action
Plugin-->>Client: Return {verdict, data, error}
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-13T16:50:38Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-13T16:50:49Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-75%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added Palo Alto Networks Prisma AIRS API plugin
- Integrated new API intercept mechanism

### 🔍 Impact of the Change
- Enables seamless integration with Prisma AIRS API
- Provides new intercepting capabilities

### 📁 Total Files Changed
- Configuration files updated
- New plugin implementation added

### 🧪 Test Added
- Unit tests for plugin functionality
- Integration tests for API interactions

### 🔒 Security Vulnerabilities
- No immediate security risks detected

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
participant GithubPR as GitHub PR
participant PrismaAIRS as Prisma AIRS API
participant PluginSystem as Plugin Integration

GithubPR->>PrismaAIRS: Initiate API Integration
PrismaAIRS-->>PluginSystem: Establish Connection
PluginSystem->>PrismaAIRS: Configure Intercept Settings
Note over PluginSystem: Plugin Configuration
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T12:49:58Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T12:50:14Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-85%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added PANW Prisma AIRS plugin for AI security guardrail
- Implemented intercept mechanism for prompt/response blocking
- Created manifest and test files for the plugin

### 🔍 Impact of the Change
- Enables AI security checks via Palo Alto Networks Prisma AIRS API
- Provides guardrail functionality for blocking potentially harmful AI interactions
- Supports both beforeRequestHook and afterRequestHook

### 📁 Total Files Changed
- 3 files added: 
  1. intercept.ts
  2. manifest.json
  3. panw.airs.test.ts

### 🧪 Test Added
- Unit test for PANW Prisma AIRS Guardrail
- Verifies handler returns correct result object
- Checks for verdict, data, and error properties

### 🔒 Security Vulnerabilities
- Requires API key for authentication
- Supports environment and credential-based configuration
- Implements basic error handling for API responses

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I have added tests that prove my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
participant Client
participant PanwPrismaAirsPlugin
participant AIRSApi

Client->>PanwPrismaAirsPlugin: Invoke handler(ctx, params, hook)
PanwPrismaAirsPlugin->>PanwPrismaAirsPlugin: Extract API Key
PanwPrismaAirsPlugin->>PanwPrismaAirsPlugin: Generate payload
PanwPrismaAirsPlugin->>AIRSApi: POST /v1/scan/sync/request
AIRSApi-->>PanwPrismaAirsPlugin: Response with action
PanwPrismaAirsPlugin->>PanwPrismaAirsPlugin: Determine verdict
PanwPrismaAirsPlugin-->>Client: Return {verdict, data, error}
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T12:51:17Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T12:51:18Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-75%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added Palo Alto Networks Prisma AIRS API plugin
- Integrated new API intercept mechanism

### 🔍 Impact of the Change
- Enables seamless integration with Prisma AIRS API
- Provides new intercepting capabilities

### 📁 Total Files Changed
- Configuration files updated
- New plugin implementation added

### 🧪 Test Added
- Unit tests for plugin functionality
- Integration tests for API interactions

### 🔒 Security Vulnerabilities
- No immediate security risks detected

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
participant GithubPR as GitHub PR
participant PrismaAIRS as Prisma AIRS API
participant PluginSystem as Plugin Integration

GithubPR->>PrismaAIRS: Initiate API Integration
PrismaAIRS-->>PluginSystem: Establish Connection
PluginSystem->>PrismaAIRS: Configure Intercept Settings
Note over PluginSystem: Plugin Configuration
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T13:09:43Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T13:09:44Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-75%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added Palo Alto Networks Prisma AIRS Plugin
- Integrated new API intercept functionality

### 🔍 Impact of the Change
- Enables integration with Prisma AIRS API
- Provides new intercepting capabilities

### 📁 Total Files Changed
- Configuration files updated
- New plugin implementation

### 🧪 Test Added
- Unit tests for plugin functionality
- API connection tests
- Intercept data retrieval tests

### 🔒 Security Vulnerabilities
- Potential API authentication risks
- Recommended secure token management

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code
- [x] I have added tests that prove my feature works

## Sequence Diagram

```mermaid
sequenceDiagram
participant PaloAltoNetworks as PAN
participant PrismaAIRS as AIRS
participant Plugin as Plugin

PAN->>AIRS: Initialize API Connection
AIRS-->>Plugin: Authenticate
Plugin->>AIRS: Fetch Intercept Data
AIRS-->>Plugin: Return Intercept Results
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T15:59:47Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T15:59:59Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-75%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added Palo Alto Networks Prisma AIRS plugin
- Integrated new intercept handler in plugins index

### 🔍 Impact of the Change
- Extends plugin ecosystem with Prisma AIRS integration
- Provides new intercept mechanism for security monitoring

### 📁 Total Files Changed
- 1 file: plugins/index.ts

### 🧪 Test Added
- No specific tests mentioned in PR

### 🔒 Security Vulnerabilities
- No explicit security vulnerabilities detected

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?
- [ ] Unit Tests
- [ ] Integration Tests
- [ ] Manual Testing

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
participant Plugins as Plugins
participant PanwPrismaAirs as PanwPrismaAirs
participant Intercept as Intercept

Plugins->>PanwPrismaAirs: Import handler
PanwPrismaAirs->>Intercept: Register intercept handler
Note over Plugins, Intercept: Plugin Registration Flow
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T16:44:42Z
body: > [!IMPORTANT]
> ## PR Review Skipped
> PR review skipped as per the configuration setting. Run a manually review by commenting <kbd>/matter review</kbd>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- `/matter summary`: Generate AI Summary for the PR
- `/matter review`: Generate AI Reviews for the latest commit in the PR
- `/matter review-full`: Generate AI Reviews for the complete PR
- `/matter release-notes`: Generate AI release-notes for the PR
- `/matter <ask-question>`: Chat with your PR with Matter AI Agent
- `/matter remember <recommendation>`: Generate AI memories for the PR
- `/matter explain`: Get an explanation of the PR
- `/matter help`: Show the list of available commands and documentation
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-14T16:44:54Z
body: ![Code Quality](https://img.shields.io/badge/Code_Quality-85%25-d47f00) ![new feature](https://img.shields.io/badge/new_feature-818aff) 

# Summary By MatterAI <a href="https://app.matterai.dev" target="_blank"> <img src="https://avatars.githubusercontent.com/u/150887532?s=48" width="22" height="22" alt="MatterAI logo"/></a>

### 🔄 What Changed
- Added PANW Prisma AIRS plugin integration
- Imported new intercept handler for Prisma AIRS
- Updated plugins configuration

### 🔍 Impact of the Change
- Introduces new plugin for Palo Alto Networks Prisma AIRS API Intercept
- Extends existing plugin architecture
- Minimal changes to existing codebase

### 📁 Total Files Changed
- 1 file: `plugins/index.ts`

### 🧪 Test Added
- No specific tests mentioned in PR description
- Recommended to add unit and integration tests for new plugin

### 🔒 Security Vulnerabilities
- No immediate security vulnerabilities detected
- Recommended to validate plugin configuration and input handling

## Type of Change
- [x] New feature (non-breaking change which adds functionality)

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my feature works
- [ ] New and existing unit tests pass locally with my changes

## Sequence Diagram

```mermaid
sequenceDiagram
    participant Plugins as Plugins Module
    participant PanwPrismaAirs as PANW Prisma AIRS Plugin
    participant Intercept as Intercept Handler

    Plugins->>PanwPrismaAirs: Import intercept handler
    PanwPrismaAirs-->>Plugins: Register 'panw-prisma-airs' plugin
    Plugins->>Intercept: Configure intercept method
```

author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-16T15:47:21Z
body: > [!NOTE]
> ## PR Review Skipped
> PR review skipped as no relevant changes found due to large diff hunk OR part of a non-reviewable file.

<details>

<summary>📄Files skipped in review</summary>

- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined

</details>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- <kbd>/matter summary</kbd>: Generate AI Summary for the PR
- <kbd>/matter review</kbd>: Generate AI Reviews for the latest commit in the PR
- <kbd>/matter review-full</kbd>: Generate AI Reviews for the complete PR
- <kbd>/matter release-notes</kbd>: Generate AI release-notes for the PR
- <kbd>/matter <ask-question></ask-question></kbd>: Chat with your PR with Matter AI Agent
- <kbd>/matter remember <recommendation></recommendation></kbd>: Generate AI memories for the PR
- <kbd>/matter explain</kbd>: Get an explanation of the PR
- <kbd>/matter help</kbd>: Show the list of available commands and documentation
- Need help? Join our Discord server: [https://discord.gg/fJU5DvanU3](https://discord.gg/fJU5DvanU3)
</details>
author_association: CONTRIBUTOR
user: login: matterai-app[bot]
created_at: 2025-05-20T14:42:29Z
body: > [!NOTE]
> ## PR Review Skipped
> PR review skipped as no relevant changes found due to large diff hunk OR part of a non-reviewable file.

<details>

<summary>📄Files skipped in review</summary>

- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined
- `undefined`: undefined

</details>

<details>

<summary>💡Tips to use Matter AI</summary>

### Command List

- <kbd>/matter summary</kbd>: Generate AI Summary for the PR
- <kbd>/matter review</kbd>: Generate AI Reviews for the latest commit in the PR
- <kbd>/matter review-full</kbd>: Generate AI Reviews for the complete PR
- <kbd>/matter release-notes</kbd>: Generate AI release-notes for the PR
- <kbd>/matter <ask-question></ask-question></kbd>: Chat with your PR with Matter AI Agent
- <kbd>/matter remember <recommendation></recommendation></kbd>: Generate AI memories for the PR
- <kbd>/matter explain</kbd>: Get an explanation of the PR
- <kbd>/matter help</kbd>: Show the list of available commands and documentation
- Need help? Join our Discord server: [https://discord.gg/fJU5DvanU3](https://discord.gg/fJU5DvanU3)
</details>
author_association: CONTRIBUTOR