Security & Strict Mode¶
Magetools is designed from the ground up to prevent unauthorized code execution by AI agents.
๐ก๏ธ Strict Mode¶
By default, Magetools runs in Strict Mode. This is a safety layer that ensures no code is loaded or executed without explicit developer consent.
[!IMPORTANT] In Strict Mode, Magetools will ignore any directory that does not contain a valid
manifest.json.
๐ The Manifest (manifest.json)¶
The manifest is your control plane for collection-level security.
{
"name": "Math Collection",
"description": "Basic arithmetic tools",
"enabled": true,
"whitelist": ["add_numbers", "multiply_numbers"]
}
enabled: Set tofalseto instantly disable a collection.whitelist: Only functions listed here will be exposed to the agent.blacklist: Explicitly forbid specific functions, even if they have the@spelldecorator.
๐งช Prompt Injection Protection¶
When generating automated metadata summaries, Magetools defends against Indirect Prompt Injection:
- Sanitization: We redact common "jailbreak" keywords from tool docstrings.
- Delimitation: Tool data is wrapped in hardened security markers to prevent the model from following instructions found in docstrings.
๐ฅ Quarantine¶
If a tool file fails to load due to syntax errors or security violations, it is moved to a virtual Quarantine.
[!WARNING] Tools in quarantine are completely inaccessible to the agent and will trigger a warning in the
magetools scanreport.