claude-agent-sdk
Audited by Socket on Sep 4, 2026
2 alerts found:
Securityx2Moderate-to-high risk: the code explicitly includes a bypassAllPermissions() function that sets permissionMode to 'bypassPermissions', indicating an intentional attempt to circumvent tool permission controls. Additional functions auto-approve edits and output agent responses and tool inputs to console, increasing the likelihood of unauthorized actions and sensitive information leakage in logs. While customPermissions/environmentBasedPermissions implement some filtering, the presence of explicit permission bypass logic is the primary malicious/sabotage indicator.
The highest-risk finding is the calculate tool’s direct eval() of an attacker-influenced free-form expression, which can enable arbitrary JavaScript execution in the host environment. Other issues include unsafe URL construction without URL encoding for the weather request and potential leakage via console logging and returning error.message. No obvious stealth malware or credential exfiltration logic is evident in this specific fragment beyond the eval-driven risk.