ExecFence
Add stack-aware guardrails that fail fast before dev/build/test/CI when a persistent project could execute attacker-controlled code.
Trigger
Use this skill automatically for:
- Web apps, desktop apps, CLIs, local agents, backend services, CI/CD projects, or apps that read/write user files.
- Projects using executable configuration or package hooks:
package.json, vite.config.*, next.config.*, postcss.config.*, tailwind.config.*, eslint.config.*, webpack.config.*, Makefile, go test, build.rs, pyproject.toml, setup.py, .vscode/tasks.json, GitHub Actions.
- Requests involving persistence, build hardening, malware injection, supply-chain risk, local filesystem access, token/credential handling, browser/desktop integration, or security guardrails.
Skip only for throwaway snippets, one-off static files, pure documentation, or when the user explicitly says not to add guardrails.
Workflow
- Detect stack and execution surfaces.
- Prefer
npx --yes execfence guard enable to preview automatic project setup.
- Use
npx --yes execfence guard enable --apply when the user wants the project wired automatically.
- Integrate normal build/test/dev commands with
execfence run -- <command>.
- Ignore dependency/build/cache folders to keep false positives low.
- Verify with direct scanner execution and one stack-specific command.
Prefer these commands when available:
npx --yes execfence init --preset auto
npx --yes execfence guard enable
npx --yes execfence guard enable --apply
npx --yes execfence guard status
npx --yes execfence guard disable
npx --yes execfence guard global-status
npx --yes execfence guard global-enable
npx --yes execfence guard global-disable
npx --yes execfence run -- npm test
npx --yes execfence run -- npm run build
npx --yes execfence run --sandbox-mode audit -- npm test
npx --yes execfence run --dependency-behavior-audit --sandbox-mode audit -- npm test
npx --yes execfence run --sandbox -- npm test
npx --yes execfence sandbox doctor
npx --yes execfence sandbox plan -- npm test
npx --yes execfence run --record-artifacts --deny-on-new-executable -- npm test
npx --yes execfence ci
npx --yes execfence adopt
npx --yes execfence adopt --write-baseline
npx --yes execfence wire --dry-run
npx --yes execfence deps diff
npx --yes execfence deps review
npx --yes execfence policy explain
npx --yes execfence policy test
npx --yes execfence manifest
npx --yes execfence manifest diff
npx --yes execfence scan --ci --format json
npx --yes execfence scan --mode audit --ci --format json
npx --yes execfence scan --fail-on critical,high
npx --yes execfence scan --ci --format sarif
npx --yes execfence diff-scan --staged
npx --yes execfence coverage
npx --yes execfence scan-history --max-commits 1000
npx --yes execfence doctor
npx --yes execfence pack-audit
npx --yes execfence trust audit
npx --yes execfence baseline add --from-report .execfence/reports/<report>.json --owner <owner> --reason <reason> --expires-at <date>
npx --yes execfence agent-report
npx --yes execfence reports list
npx --yes execfence reports latest
npx --yes execfence reports open <report>
npx --yes execfence report --markdown .execfence/reports/<report>.json
npx --yes execfence enrich --preview .execfence/reports/<report>.json
npx --yes execfence incident bundle --from-report .execfence/reports/<report>.json
npx --yes execfence pr-comment --report .execfence/reports/<report>.json
npx --yes execfence explain suspicious-package-script
npx --yes execfence install-hooks
npx --yes execfence install-agent-rules --scope project
npx --yes execfence install-agent-rules --verify --scope project
guard enable is dry-run by default. It should be the first recommendation when the user wants project-local automatic protection for test, build, dev, pack, publish, CI, and agent-driven execution. guard global-enable installs skill/defaults, global agent rules, and reversible npm/npx/pnpm/yarn/yarnpkg/bun/bunx shims under <home>/.execfence/shims/ with marked shell-profile PATH blocks. Use guard global-disable to remove those shims and PATH blocks.
Minimum Detections
Block known injected JavaScript loader IoCs:
global.i='2-30-4'
_$_a7ae
_$_d609
tLl(5394)
global['_V']
api.trongrid.io/v1/accounts
fullnode.mainnet.aptoslabs.com/v1/accounts
bsc-dataseed.binance.org
bsc-rpc.publicnode.com
eth_getTransactionByHash
temp_auto_push
Block suspicious execution patterns:
.vscode/tasks.json with "runOn": "folderOpen"
global[...] = require in executable JS/config files
- dynamic
Function/constructor loaders that combine eval, fromCharCode, or child_process
- very long obfuscated JavaScript lines with loader markers
- executable artifacts such as
.exe, .dll, .bat, .cmd, .scr, .vbs, .wsf inside source/build-input folders
- suspicious npm lifecycle scripts and insecure or suspicious npm/pnpm/yarn/bun/Cargo/Go/Python lockfile URLs
Prefer project config under .execfence/config/ for policy packs, reviewed exceptions, extra literal IoCs, extra regex detections, reports, and audit/block mode instead of weakening scanner code. When allowing a committed executable, use a { "path": "...", "sha256": "..." } entry. Put team-specific IoCs in .execfence/config/signatures.json and reviewed legacy findings in .execfence/config/baseline.json with an owner, reason, expiry, and hash.
User Configuration Surface
Create project configuration through execfence init:
.execfence/config/execfence.json: main config for policyPack, mode, blockSeverities, warnSeverities, scan roots, ignoreDirs, skipFiles, allowExecutables, extraSignatures, extraRegexSignatures, signaturesFile, baselineFile, reportsDir, reportsGitignore, runtimeTrace, analysis.webEnrichment, manifest.blockNewEntrypoints, ci, wire, deps, supplyChain.mode, supplyChain.metadata, supplyChain.reputation, adopt, policy, trustStore, reportRetention, reports.retention, htmlReport, redaction, workflowHardening, archiveAudit, and auditAllPackageScripts.
.execfence/config/signatures.json: optional team-owned literal and regex indicators. Use this for new IoCs instead of editing scanner code.
.execfence/config/baseline.json: optional reviewed exceptions for existing findings. Require findingId, file, reason, owner, expiresAt, and preferably sha256.
.execfence/config/sandbox.json: sandbox policy for execfence run --sandbox, including mode, profile, filesystem, process, network, and helper settings. Audit mode is evidence without a helper; enforce mode must block if network/filesystem/sensitive-read/child-process/new-executable enforcement is unavailable unless the user explicitly uses --allow-degraded.
.execfence/config/policies/*.json: optional project/team policy packs selected by policyPack.
.execfence/reports/: automatic JSON reports. Keep it gitignored unless the user sets reportsGitignore: false.
.execfence/manifest.json: generated execution-surface manifest for package scripts, Makefiles, workflows, tasks, hooks, language build files, and agent rules.
.execfence/cache/enrichment/: local cache for public-source enrichment of critical/high findings.
.execfence/trust/*.json: trust stores for reviewed files, actions, registries, package scopes, and package sources.
.execfence/helper/execfence-helper.json: optional helper metadata. Validate with execfence helper audit; do not trust helpers without hash/provenance metadata.
.execfence/quarantine/<report-id>/metadata.json: quarantine metadata only; do not delete payloads automatically.
<home>/.agents/skills/execfence/defaults.json: read-only global defaults installed with the skill. Do not ask the user to edit it; project config wins.
Evidence is created automatically for run, scan, diff-scan, scan-history, and doctor. Each report is a new .execfence/reports/<project>_<datetime>.json file with findings, snippets, hashes, git evidence, local analysis, runtime trace when available, and research queries. For dependency changes, prefer deps review to aggregate npm/pnpm/yarn lockfiles with guarded metadata/reputation checks for release cooldown, OSV advisories, package reputation, deprecation/security text, source, integrity, provenance/signature hints, tarball content, tarball delta, lifecycle/bin hints, privacy status, and recommended actions. Use supplyChain.mode: "strict" in CI/release/security-sensitive repos when unavailable signals, cooldowns, missing integrity/provenance, uncovered package-manager surfaces, and runtime dependency behavior without helper enforcement should block. For commands likely to import changed dependencies, prefer execfence run --dependency-behavior-audit --sandbox-mode audit -- <command> for evidence or --sandbox with a verified helper for enforcement. For critical and high findings, enrich with public safe sources (OSV, GitHub Advisory, npm metadata, CISA KEV, and reputable web sources when available) after redacting local paths and sensitive snippets. Network/enrichment failure never lowers severity or unblocks execution. Do not delete or rewrite suspicious payloads automatically.
Preferred CLI
When the package is available, prefer:
npx --yes execfence init
npx --yes execfence run -- npm test
npx --yes execfence scan
Final Report
Report files changed, commands wired, detections covered, verification results, and remaining runtime/credential risks.
Source: chrystyan96/ExecFence — distributed by TomeVault.
1---2name: execfence3description: Use when creating or hardening persistent projects that run on the web, build executable code, use Node/Go/Rust/Python supply chains, run CI/CD, or access the user's filesystem, credentials, browser, network, shell, desktop APIs, or local machine. Evaluates the stack and adds lightweight malware/supply-chain guardrails to block known injected payloads, suspicious executable configs, autostart tasks, and unexpected binaries before build/test/dev.4---56# ExecFence78Add stack-aware guardrails that fail fast before dev/build/test/CI when a persistent project could execute attacker-controlled code.910## Trigger1112Use this skill automatically for:13- Web apps, desktop apps, CLIs, local agents, backend services, CI/CD projects, or apps that read/write user files.14- Projects using executable configuration or package hooks: `package.json`, `vite.config.*`, `next.config.*`, `postcss.config.*`, `tailwind.config.*`, `eslint.config.*`, `webpack.config.*`, `Makefile`, `go test`, `build.rs`, `pyproject.toml`, `setup.py`, `.vscode/tasks.json`, GitHub Actions.15- Requests involving persistence, build hardening, malware injection, supply-chain risk, local filesystem access, token/credential handling, browser/desktop integration, or security guardrails.1617Skip only for throwaway snippets, one-off static files, pure documentation, or when the user explicitly says not to add guardrails.1819## Workflow20211. Detect stack and execution surfaces.222. Prefer `npx --yes execfence guard enable` to preview automatic project setup.233. Use `npx --yes execfence guard enable --apply` when the user wants the project wired automatically.244. Integrate normal build/test/dev commands with `execfence run -- <command>`.255. Ignore dependency/build/cache folders to keep false positives low.266. Verify with direct scanner execution and one stack-specific command.2728Prefer these commands when available:2930```sh31npx --yes execfence init --preset auto32npx --yes execfence guard enable33npx --yes execfence guard enable --apply34npx --yes execfence guard status35npx --yes execfence guard disable36npx --yes execfence guard global-status37npx --yes execfence guard global-enable38npx --yes execfence guard global-disable39npx --yes execfence run -- npm test40npx --yes execfence run -- npm run build41npx --yes execfence run --sandbox-mode audit -- npm test42npx --yes execfence run --dependency-behavior-audit --sandbox-mode audit -- npm test43npx --yes execfence run --sandbox -- npm test44npx --yes execfence sandbox doctor45npx --yes execfence sandbox plan -- npm test46npx --yes execfence run --record-artifacts --deny-on-new-executable -- npm test47npx --yes execfence ci48npx --yes execfence adopt49npx --yes execfence adopt --write-baseline50npx --yes execfence wire --dry-run51npx --yes execfence deps diff52npx --yes execfence deps review53npx --yes execfence policy explain54npx --yes execfence policy test55npx --yes execfence manifest56npx --yes execfence manifest diff57npx --yes execfence scan --ci --format json58npx --yes execfence scan --mode audit --ci --format json59npx --yes execfence scan --fail-on critical,high60npx --yes execfence scan --ci --format sarif61npx --yes execfence diff-scan --staged62npx --yes execfence coverage63npx --yes execfence scan-history --max-commits 100064npx --yes execfence doctor65npx --yes execfence pack-audit66npx --yes execfence trust audit67npx --yes execfence baseline add --from-report .execfence/reports/<report>.json --owner <owner> --reason <reason> --expires-at <date>68npx --yes execfence agent-report69npx --yes execfence reports list70npx --yes execfence reports latest71npx --yes execfence reports open <report>72npx --yes execfence report --markdown .execfence/reports/<report>.json73npx --yes execfence enrich --preview .execfence/reports/<report>.json74npx --yes execfence incident bundle --from-report .execfence/reports/<report>.json75npx --yes execfence pr-comment --report .execfence/reports/<report>.json76npx --yes execfence explain suspicious-package-script77npx --yes execfence install-hooks78npx --yes execfence install-agent-rules --scope project79npx --yes execfence install-agent-rules --verify --scope project80```8182`guard enable` is dry-run by default. It should be the first recommendation when the user wants project-local automatic protection for `test`, `build`, `dev`, `pack`, `publish`, CI, and agent-driven execution. `guard global-enable` installs skill/defaults, global agent rules, and reversible `npm`/`npx`/`pnpm`/`yarn`/`yarnpkg`/`bun`/`bunx` shims under `<home>/.execfence/shims/` with marked shell-profile PATH blocks. Use `guard global-disable` to remove those shims and PATH blocks.8384## Minimum Detections8586Block known injected JavaScript loader IoCs:87- `global.i='2-30-4'`88- `_$_a7ae`89- `_$_d609`90- `tLl(5394)`91- `global['_V']`92- `api.trongrid.io/v1/accounts`93- `fullnode.mainnet.aptoslabs.com/v1/accounts`94- `bsc-dataseed.binance.org`95- `bsc-rpc.publicnode.com`96- `eth_getTransactionByHash`97- `temp_auto_push`9899Block suspicious execution patterns:100- `.vscode/tasks.json` with `"runOn": "folderOpen"`101- `global[...] = require` in executable JS/config files102- dynamic `Function`/`constructor` loaders that combine `eval`, `fromCharCode`, or `child_process`103- very long obfuscated JavaScript lines with loader markers104- executable artifacts such as `.exe`, `.dll`, `.bat`, `.cmd`, `.scr`, `.vbs`, `.wsf` inside source/build-input folders105- suspicious npm lifecycle scripts and insecure or suspicious npm/pnpm/yarn/bun/Cargo/Go/Python lockfile URLs106107Prefer project config under `.execfence/config/` for policy packs, reviewed exceptions, extra literal IoCs, extra regex detections, reports, and audit/block mode instead of weakening scanner code. When allowing a committed executable, use a `{ "path": "...", "sha256": "..." }` entry. Put team-specific IoCs in `.execfence/config/signatures.json` and reviewed legacy findings in `.execfence/config/baseline.json` with an owner, reason, expiry, and hash.108109## User Configuration Surface110111Create project configuration through `execfence init`:112- `.execfence/config/execfence.json`: main config for `policyPack`, `mode`, `blockSeverities`, `warnSeverities`, scan `roots`, `ignoreDirs`, `skipFiles`, `allowExecutables`, `extraSignatures`, `extraRegexSignatures`, `signaturesFile`, `baselineFile`, `reportsDir`, `reportsGitignore`, `runtimeTrace`, `analysis.webEnrichment`, `manifest.blockNewEntrypoints`, `ci`, `wire`, `deps`, `supplyChain.mode`, `supplyChain.metadata`, `supplyChain.reputation`, `adopt`, `policy`, `trustStore`, `reportRetention`, `reports.retention`, `htmlReport`, `redaction`, `workflowHardening`, `archiveAudit`, and `auditAllPackageScripts`.113- `.execfence/config/signatures.json`: optional team-owned literal and regex indicators. Use this for new IoCs instead of editing scanner code.114- `.execfence/config/baseline.json`: optional reviewed exceptions for existing findings. Require `findingId`, `file`, `reason`, `owner`, `expiresAt`, and preferably `sha256`.115- `.execfence/config/sandbox.json`: sandbox policy for `execfence run --sandbox`, including `mode`, `profile`, filesystem, process, network, and helper settings. Audit mode is evidence without a helper; enforce mode must block if network/filesystem/sensitive-read/child-process/new-executable enforcement is unavailable unless the user explicitly uses `--allow-degraded`.116- `.execfence/config/policies/*.json`: optional project/team policy packs selected by `policyPack`.117- `.execfence/reports/`: automatic JSON reports. Keep it gitignored unless the user sets `reportsGitignore: false`.118- `.execfence/manifest.json`: generated execution-surface manifest for package scripts, Makefiles, workflows, tasks, hooks, language build files, and agent rules.119- `.execfence/cache/enrichment/`: local cache for public-source enrichment of critical/high findings.120- `.execfence/trust/*.json`: trust stores for reviewed files, actions, registries, package scopes, and package sources.121- `.execfence/helper/execfence-helper.json`: optional helper metadata. Validate with `execfence helper audit`; do not trust helpers without hash/provenance metadata.122- `.execfence/quarantine/<report-id>/metadata.json`: quarantine metadata only; do not delete payloads automatically.123- `<home>/.agents/skills/execfence/defaults.json`: read-only global defaults installed with the skill. Do not ask the user to edit it; project config wins.124125Evidence is created automatically for `run`, `scan`, `diff-scan`, `scan-history`, and `doctor`. Each report is a new `.execfence/reports/<project>_<datetime>.json` file with findings, snippets, hashes, git evidence, local analysis, runtime trace when available, and research queries. For dependency changes, prefer `deps review` to aggregate npm/pnpm/yarn lockfiles with guarded metadata/reputation checks for release cooldown, OSV advisories, package reputation, deprecation/security text, source, integrity, provenance/signature hints, tarball content, tarball delta, lifecycle/bin hints, privacy status, and recommended actions. Use `supplyChain.mode: "strict"` in CI/release/security-sensitive repos when unavailable signals, cooldowns, missing integrity/provenance, uncovered package-manager surfaces, and runtime dependency behavior without helper enforcement should block. For commands likely to import changed dependencies, prefer `execfence run --dependency-behavior-audit --sandbox-mode audit -- <command>` for evidence or `--sandbox` with a verified helper for enforcement. For `critical` and `high` findings, enrich with public safe sources (OSV, GitHub Advisory, npm metadata, CISA KEV, and reputable web sources when available) after redacting local paths and sensitive snippets. Network/enrichment failure never lowers severity or unblocks execution. Do not delete or rewrite suspicious payloads automatically.126127## Preferred CLI128129When the package is available, prefer:130131```sh132npx --yes execfence init133npx --yes execfence run -- npm test134npx --yes execfence scan135```136137## Final Report138139Report files changed, commands wired, detections covered, verification results, and remaining runtime/credential risks.140141---142> Source: [chrystyan96/ExecFence](https://github.com/chrystyan96/ExecFence) — distributed by [TomeVault](https://tomevault.io).143<!-- tomevault:4.0:skill_md:2026-06-18 -->