Which SDK is this for?
Both
Feature Type
New Guardrail
Problem Statement
The built-in guardrails (PII detection, prompt injection, content moderation) are great, but I need to add custom rules specific to my domain (e.g., blocking certain industry-specific terms).
Proposed Solution
Add a plugin system that allows developers to register custom guardrail functions that run alongside the built-in ones.
Alternatives Considered
No response
Use Case
In my healthcare application, I need to block certain medical terms and ensure HIPAA compliance beyond standard PII detection. I want to define custom rules without forking the SDK.
Example Code
import { TealOpenAI, CustomGuardrail } from 'tealtiger';
const medicalTermsGuardrail: CustomGuardrail = {
name: 'medical-terms-blocker',
check: async (input: string) => {
const blockedTerms = ['diagnosis', 'prescription', 'treatment'];
const found = blockedTerms.find(term => input.toLowerCase().includes(term));
return {
passed: !found,
reason: found ? `Blocked medical term: ${found}` : undefined,
};
},
};
const client = new TealOpenAI({
apiKey: process.env.OPENAI_API_KEY,
enableGuardrails: true,
customGuardrails: [medicalTermsGuardrail],
});
Would you like to contribute this feature?
Additional Context
No response
Which SDK is this for?
Both
Feature Type
New Guardrail
Problem Statement
The built-in guardrails (PII detection, prompt injection, content moderation) are great, but I need to add custom rules specific to my domain (e.g., blocking certain industry-specific terms).
Proposed Solution
Add a plugin system that allows developers to register custom guardrail functions that run alongside the built-in ones.
Alternatives Considered
No response
Use Case
In my healthcare application, I need to block certain medical terms and ensure HIPAA compliance beyond standard PII detection. I want to define custom rules without forking the SDK.
Example Code
Would you like to contribute this feature?
Additional Context
No response