Raw untrusted content from GitHub
GitHub user's relationship to the repository
GitHub username (for allowlist check)
Optionalconfig: Partial<Optional sanitizer configuration
SanitizedInput with cleaned content and audit data
Sanitized content with dangerous elements removed.
Original content before sanitization (for audit).
Assigned trust tier based on user role and content analysis.
GitHub user role of the input source.
Injection patterns detected in content.
Elements stripped during sanitization (audit trail).
Whether any dangerous content was detected and stripped.
Timestamp of sanitization (ISO 8601).
Sanitizes untrusted GitHub input through the full Layer 1 pipeline:
⚠ Use HostileInputFirewall.process() in agent code paths. Calling sanitizeInput() directly only runs Layer 1 — it does not evaluate the Rule of Two (enforced in policy-gate.ts via evaluatePolicy) and does not emit audit-trail events. An agent that processes untrusted input while holding both write access and secrets violates the Rule of Two; the policy gate is what catches this, and it only runs inside the firewall pipeline. Direct use of this function is appropriate for unit tests and pure content analysis, not for agent decision paths.