This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Strict font allowlist (absolute paths only) | |
| const FONT_MAP = Object.freeze({ | |
| "dejavu-sans": "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", | |
| "dejavu-sans-bold": "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", | |
| "dejavu-mono": "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf", | |
| "noto-sans": "/usr/share/fonts/noto/NotoSans-Regular.ttf", | |
| "liberation-sans": "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf" | |
| }); | |
| // Validate and sanitize text (reject ImageMagick coders) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Trust boundaries: Anything from network = untrusted data | |
| // Anything from LLM = untrusted instructions | |
| // Tool scoping with policy allow-list | |
| const ALLOWED_TOOLS = { | |
| azure_invoke: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Helper: create a null-prototype object with fields | |
| function obj(data) { | |
| return Object.assign(Object.create(null), data) | |
| } | |
| // Safe deep merge that prevents prototype pollution |