|
| 1 | +import type { IntegrationPlugin } from "../registry"; |
| 2 | +import { registerIntegration } from "../registry"; |
| 3 | +import { guardCodegenTemplate } from "./codegen/guard"; |
| 4 | +import { redactCodegenTemplate } from "./codegen/redact"; |
| 5 | +import { SuperagentIcon } from "./icon"; |
| 6 | + |
| 7 | +const superagentPlugin: IntegrationPlugin = { |
| 8 | + type: "superagent", |
| 9 | + label: "Superagent", |
| 10 | + description: "AI guardrails for prompt injection detection and PII redaction", |
| 11 | + |
| 12 | + icon: SuperagentIcon, |
| 13 | + |
| 14 | + formFields: [ |
| 15 | + { |
| 16 | + id: "superagentApiKey", |
| 17 | + label: "API Key", |
| 18 | + type: "password", |
| 19 | + placeholder: "sa-...", |
| 20 | + configKey: "superagentApiKey", |
| 21 | + envVar: "SUPERAGENT_API_KEY", |
| 22 | + helpText: "Get your API key from ", |
| 23 | + helpLink: { |
| 24 | + text: "superagent.sh", |
| 25 | + url: "https://app.superagent.sh", |
| 26 | + }, |
| 27 | + }, |
| 28 | + ], |
| 29 | + |
| 30 | + testConfig: { |
| 31 | + getTestFunction: async () => { |
| 32 | + const { testSuperagent } = await import("./test"); |
| 33 | + return testSuperagent; |
| 34 | + }, |
| 35 | + }, |
| 36 | + |
| 37 | + actions: [ |
| 38 | + { |
| 39 | + slug: "guard", |
| 40 | + label: "Guard", |
| 41 | + description: |
| 42 | + "Detect prompt injection, system prompt extraction, or data exfiltration attempts", |
| 43 | + category: "Superagent", |
| 44 | + stepFunction: "superagentGuardStep", |
| 45 | + stepImportPath: "guard", |
| 46 | + configFields: [ |
| 47 | + { |
| 48 | + key: "text", |
| 49 | + label: "Text", |
| 50 | + type: "template-textarea", |
| 51 | + placeholder: "Text to analyze or {{NodeName.text}}", |
| 52 | + example: "Analyze this user input for security threats", |
| 53 | + required: true, |
| 54 | + rows: 4, |
| 55 | + }, |
| 56 | + ], |
| 57 | + codegenTemplate: guardCodegenTemplate, |
| 58 | + }, |
| 59 | + { |
| 60 | + slug: "redact", |
| 61 | + label: "Redact", |
| 62 | + description: |
| 63 | + "Remove sensitive information (PII/PHI) like SSNs, emails, and phone numbers from text", |
| 64 | + category: "Superagent", |
| 65 | + stepFunction: "superagentRedactStep", |
| 66 | + stepImportPath: "redact", |
| 67 | + configFields: [ |
| 68 | + { |
| 69 | + key: "text", |
| 70 | + label: "Text", |
| 71 | + type: "template-textarea", |
| 72 | + placeholder: "Text to redact or {{NodeName.text}}", |
| 73 | + example: "My email is john@example.com and SSN is 123-45-6789", |
| 74 | + required: true, |
| 75 | + rows: 4, |
| 76 | + }, |
| 77 | + { |
| 78 | + key: "entities", |
| 79 | + label: "Entity Types", |
| 80 | + type: "text", |
| 81 | + placeholder: "Optional: SSN, EMAIL, PHONE (comma-separated)", |
| 82 | + example: "", |
| 83 | + }, |
| 84 | + ], |
| 85 | + codegenTemplate: redactCodegenTemplate, |
| 86 | + }, |
| 87 | + ], |
| 88 | +}; |
| 89 | + |
| 90 | +// Auto-register on import |
| 91 | +registerIntegration(superagentPlugin); |
| 92 | + |
| 93 | +export default superagentPlugin; |
0 commit comments