@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
23 lines • 1.04 kB
TypeScript
import type { Finding } from '../types.js';
/**
* Prompt-injection / jailbreak heuristics. Each signal has a weight; the text's score is the
* noisy-OR of the distinct signals that fired (1 - Π(1 - w)), so one strong signal or several weak
* ones cross the threshold. English, Portuguese (PT-BR) and Spanish phrasings, role/delimiter
* spoofing, hidden Unicode (tag characters, bidi overrides, zero-width runs) and exfiltration
* through rendered links/images.
*/
export interface Signal {
id: string;
re: RegExp;
weight: number;
}
export declare const INJECTION_SIGNALS: Signal[];
/** Decodes Unicode tag characters ("ASCII smuggling") back to the ASCII they encode. */
export declare function decodeTagChars(s: string): string;
export interface InjectionResult {
score: number;
findings: Finding[];
}
/** Scores a text; findings are returned only when the score reaches `threshold`. */
export declare function scoreInjection(text: string, threshold?: number): InjectionResult;
//# sourceMappingURL=injection.d.ts.map