@openguardrails/moltguard
Version:
AI agent security plugin for OpenClaw: prompt injection detection, PII sanitization, and monitoring dashboard
59 lines • 1.74 kB
TypeScript
/**
* AI Security Gateway Manager (Version 2)
*
* Strategy:
* - Modify openclaw.json instead of agents star/agent/models.json
* - Because ensureOpenClawModelsJson() overwrites models.json with openclaw.json
*/
type GatewayStatus = {
enabled: boolean;
running: boolean;
port: number;
url: string;
providers: string[];
};
/**
* Set dashboard port for activity reporting
*/
export declare function setDashboardPort(port: number): void;
/**
* Set dashboard session token for authentication
*/
export declare function setDashboardToken(token: string): void;
/** Set a callback to receive gateway activity events for business reporting */
export declare function setGatewayActivityCallback(cb: ((redactionCount: number, typeCounts: Record<string, number>) => void) | null): void;
/**
* Start the gateway server (in-process, embedded mode)
*/
export declare function startGateway(): Promise<void>;
/**
* Restart the gateway server (reload config)
*/
export declare function restartGateway(): Promise<void>;
/**
* Stop the gateway server completely
*/
export declare function stopGateway(): Promise<void>;
export declare function isGatewayRunning(): boolean;
/**
* Enable AI Security Gateway
* Modifies openclaw.json to route all providers through gateway
*/
export declare function enableGateway(): Promise<{
providers: string[];
warnings: string[];
}>;
/**
* Disable AI Security Gateway
* Restores original provider URLs in openclaw.json (智能恢复)
*/
export declare function disableGateway(): {
providers: string[];
warnings: string[];
};
/**
* Get gateway status
*/
export declare function getGatewayStatus(): GatewayStatus;
export {};
//# sourceMappingURL=gateway-manager.d.ts.map