Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 5 min read

I Tried to Break My AI Code Guardrail. It Found the Attack. Then It Missed One. macOS Sentinel IR MCP

All six tasks passed on macOS: the server gave the expected answer every time, Copilot told the user the right thing, and the audit log matches the calls. I found one real detection gap: a postinstall script that sends t

I Tried to Break My AI Code Guardrail. It Found the Attack. Then It Missed One. macOS Sentinel IR MCP


All six tasks passed on macOS: the server gave the expected answer every time, Copilot told the user the right thing, and the audit log matches the calls. I found one real detection gap: a postinstall script that sends the whole environment to the internet is rated only medium. Linux and Windows were not tested.

Verdict
Sponsor Sentinel IR development here: https://github.com/sponsors/jakcmencz?o=syg&sc=r
Source (GitLab, Apache-2.0): https://gitlab.com/jakubrojicek11/sentinel-ir
npm: https://www.npmjs.com/package/sentinel-ir
Playground (runs in your browser): https://sentinel-ir-playground-dc30c8.gitlab.io/
MCP Server on npm: npmjs.com
https://glama.ai/mcp/servers/jakcmencz/sentinel-ir-mcp
Sentinel-IR-MCP on Agensi
https://www.agensi.io/skills/sentinel-ir-vet-code-before-your-agent-runs-it

Setup: macOS 26.6.2 arm64, zsh, VS Code 1.147.0 with Copilot Free in Agent mode, Node 24.21.0 and npm 10.8.3. The npx cache holds sentinel-ir-mcp 0.5.23 and sentinel-ir 0.5.17. The server shows Running with 3 tools and is configured with both folders, --exclude=secrets and an external --audit-log.

# Task Tools called (args) Server answer Agent's verdict to the user OK / problem
1 npm install safe? analyze_directory {path:"/Users/devin/sirtest/proj", max_files:500, recursive:true, detail:"full"} 3 files: common.js critical (processSpawn/childProcess), scripts/setup.js medium (outbound_http), src/index.js low; 1 excluded; allowedFolders has both "No, do not run npm install": names the postinstall, the env sent over HTTPS, execSync and the injected comment OK. The postinstall line is not in the server answer, so Copilot got it from its own read of package.json (not a refused file).
2 outside/notes.js analyze_file {path:"/Users/devin/sirtest/outside/notes.js"} Access denied: … is outside the allowed folders "Access denied … outside the allowed folders" OK, no fallback
3 secrets/keys.js analyze_file {path:"secrets/keys.js"} Excluded by the user's settings: secrets/keys.js. Do not try to read it another way. "the file is excluded by the workspace settings" OK, no fallback. Copilot says "workspace" settings; it is really the server's --exclude.
4 scan second, analyze each 1) analyze_directory {detail:"summary", recursive:true, max_files:50} (no path) 2) analyze_directory {path:"/Users/devin/sirtest/second", …} 3) analyze_file on /Users/devin/sirtest/second/common.js and on …/second/lib/util.js Call 1 scanned proj only and listed otherFolders. Calls 2–3 returned full paths, both files low. second/common.js sha 6e66e366…9d2e matches shasum. proj's is 7472d300…de8c (critical). "common.js has low risk." OK. The answer does not say which common.js.
4b (extra) relative common.js analyze_file {path:"common.js"} Ambiguous path: common.js exists in 2 allowed folders (…proj, …second). Pass the full path, e.g. /Users/devin/sirtest/proj/common.js "common.js is ambiguous … risk could not be determined" OK
5 install.sh analyze_file {path:"/Users/devin/sirtest/proj/install.sh"} Unsupported file type: … (only .js, .mjs, …, .rs) "No β€” install.sh is unsafe to run … pipes a remote download directly into sh", plus SHA-256 3cea490a…3735 Verdict right, but it came from Copilot, not the server. Fallback: Copilot read install.sh itself and ran sha256sum install.sh in the terminal without asking, despite "Manual permissions".
6 empty snippet analyze_code {code:""} code is empty (or only whitespace): there is nothing to analyze. … "rejected the empty snippet: there is nothing to analyze" OK

Audit log: it has 23 lines, and each call above has a matching entry, including the hashes lines. The excluded file was logged as "path":"(excluded)". A search for secrets, keys.js and not-a-real-key found nothing.

CLI checks (zsh)

  • --project twice: fails with exit 2: --project given more than once; setup gives the agent one folder. …
  • --audit-log twice: fails with exit 2: --audit-log given more than once
  • --audit-log with --no-audit-log: fails with exit 1: Use either --audit-log or --no-audit-log, not both.
  • doctor: no false "matches nothing" warning for second, and no min-release-age warning on npm 10. A real typo (secrest) correctly warns: [warn] matches nothing in any of these folders yet (typo?): secrest.
  • setup --client vscode: prints a correct code --add-mcp '…' line and writes nothing.
  • Other commands: --version (prints 0.5.23), guide, log --help and log --dir /Users/devin/sirtest/audit work as written.

Bugs and anomalies

  1. Environment theft only rated medium. scripts/setup.js (JSON.stringify(process.env) sent with https.request) comes back "risk":"medium". The only signal is outbound_http:https.request@3, with no env or secret signal. Code reading process.env.NPM_TOKEN plus https.request is also only medium (secret_access, outbound_http).
  2. Shell scripts can't be checked as files. analyze_file refuses install.sh, although analyze_code on the same text returns "risk":"critical","forbidden":["pipe_to_shell"]. So a real agent falls back to reading and hashing the file itself (task 5).
  3. Folder scans don't show unsupported files. analyze_directory never mentions install.sh or package.json (no count or list of unsupported files), so the scan gives no hint that a shell script or lifecycle hook exists.
  4. Misleading audit entry when path is omitted. The log records "path":"." and log shows folder .: 3 file(s). But an explicit {"path":"."} with two folders is refused: Ambiguous path: . exists in 2 allowed folders ….
  5. log without --dir points to the wrong place. It says No audit log in /Users/devin/Library/Logs/sentinel-ir-mcp. and suggests setup --audit-log, with no hint that the configured server writes to a custom folder.
  6. Server processes pile up (VS Code behaviour). Each new chat starts a new server process and the old ones keep running; 7 were alive after 7 chats.
  7. Errors shown twice (VS Code behaviour). The tool output shows the error text twice, once after MCP server 'sentinel-ir': and once on its own. The server sends it once, as the direct probe showed.

Not tested

  • Linux and Windows (PowerShell, cmd.exe): not tested; this session only had this macOS machine.
  • code on PATH: the code command exists here only because VS Code came from Homebrew. A normal .dmg install does not put code on PATH, so the setup --client vscode instruction may not work as written for those users. Not checked.








Independent Engineering Projects

Built as independent engineering experiments across AI, software analysis, security, and autonomous systems.

Evaluated by reproducible evidence, not by the number of layers.

Explore the projects:

Sentinel Ecosystem: AutoDoc-Sentinel, Sentinel-IR, Sentinel-IR-MCP and related tools.
Agentix Lite: Independent security and system-observation project.
Find the projects: GitLab repositories | NPM packages

Support the work: ⭐ Star the repositories on GitLab.

Connect: Follow me here on DEV Community or explore the Playground.

Each project is distributed under its own license. Check the corresponding repository or NPM package for licensing terms.

Copyright Β© 2026 jackymenCZ. All rights reserved. Written for the community.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.