# agent-config-claude-code-v1

> agent-config-claude-code-v1: 17 Keryn rules for json (13 error, 4 warning).

Source: https://keryn.dev/rules/agent-config-claude-code-v1/

17 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**How to read a rule**

- **Severity**: How bad the finding is if it is real: `error` fails a default gate, `warning` and `info` do not.

- **Confidence**: **P0** exploitable as written; **P1** dangerous in context; **P2** a heuristic or a posture check: confirm by reading the code.

- **False-positive risk**: **low**: an exact API or flag, so hits are almost always real; **medium**: the pattern is legitimate in many programs, so check each hit; **high**: it finds a lead to confirm, so expect benign hits.

- **Edge**: The relationship the finding sits on. **reaches**: content or traffic gets to a thing; **calls**: one thing invokes another; **reads**: one thing reads from another; **writes**: one thing writes to another; **sends**: data leaves for another party; **grants**: authority is given or left unchecked; **depends_on**: something relies on a component it does not verify; **trusts**: one party believes another without evidence. The boundary it crosses, when there is one: **user->prompt** (untrusted input reaching a prompt); **model->code** (model output reaching code, a shell, a query or a page); **secret->outside** (a secret leaving the trusted side); **supply-chain** (code, models or prompts pulled in from outside).

- **Taxonomy chips**: References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

## seceng.agentcfg.allow-bash-unrestricted

`error` json claude-code, mcp

permissions.allow grants unrestricted Bash (bare Bash, Bash(\*) or Bash(:\*)), so the agent can run any shell command without a prompt. Replace with narrow prefixes such as Bash(npm run test:\*) and move risky commands to deny or ask.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-78](https://keryn.dev/taxonomies/cwe/#cwe-78-os-command-injection) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** List only the exact command prefixes the project needs in permissions.allow (for example Bash(npm run test:\*)), put destructive or network commands under permissions.deny or permissions.ask, and keep the allow list out of checked-in settings.json when it is user specific (use settings.local.json).

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "permissions": {
    "allow": [
      "Read(src/**)",
      "Bash"
    ],
    "deny": [
      "Read(.env)"
    ]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.allow-bash-unrestricted` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.allow-global-wildcard

`error` json claude-code

permissions.allow contains a bare "\*" wildcard that approves every tool. Enumerate the specific tools and command prefixes the project needs instead.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-732](https://keryn.dev/rules/?cwe=CWE-732) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Remove the "\*" entry and allow only named tools with scoped arguments; use permissions.deny for anything that must never run unattended.

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

## seceng.agentcfg.allow-risky-bash-prefix

`error` json claude-code

permissions.allow pre-approves a wildcard over a high-impact command (curl, wget, rm, sudo, sh, bash, eval, ssh, scp, nc, dd). A prompt-injected agent can fetch payloads, delete files or exfiltrate data with no confirmation. Narrow the pattern to exact subcommands or move it to ask/deny.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-78](https://keryn.dev/taxonomies/cwe/#cwe-78-os-command-injection) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Replace wildcard approvals such as Bash(curl:\*) or Bash(rm:\*) with exact, argument-pinned commands, or place them in permissions.ask or permissions.deny so a human confirms each use.

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "permissions": {
    "allow": [
      "Bash(npm run test:*)",
      "Bash(git diff:*)",
      "Bash(curl:*)"
    ]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.allow-risky-bash-prefix` at line 6 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.allow-webfetch-unrestricted

`warning` json claude-code

permissions.allow lets the agent fetch any URL (WebFetch with no domain restriction). Fetched pages are an injection channel and an exfiltration path; restrict to named domains such as WebFetch(domain:docs.example.com).

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-918](https://keryn.dev/taxonomies/cwe/#cwe-918-server-side-request-forgery) [CWE-441](https://keryn.dev/rules/?cwe=CWE-441) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Allow WebFetch only for specific documentation domains using the domain: form and keep everything else on ask or deny.

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

## seceng.agentcfg.default-mode-bypass-permissions

`error` json claude-code

permissions.defaultMode is bypassPermissions, which disables all permission prompts for every session in this project. Use default or acceptEdits and rely on a scoped allow list.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-862](https://keryn.dev/taxonomies/cwe/#cwe-862-missing-authorization) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Set permissions.defaultMode to default (or acceptEdits for edit-only automation) and run bypassPermissions only inside a disposable sandbox with no credentials.

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "model": "sonnet",
  "permissions": {
    "defaultMode": "bypassPermissions",
    "deny": ["Read(.env)"]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.default-mode-bypass-permissions` at line 4 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.hook-pipes-to-shell

`error` json claude-code

A Claude Code hook command pipes downloaded or generated content into a shell (| sh, | bash, bash &lt;(curl ...)). Hooks run automatically with the user's privileges on every matching event, so a poisoned URL becomes persistent code execution. Ship the script in the repo and call it by path.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [CWE-78](https://keryn.dev/taxonomies/cwe/#cwe-78-os-command-injection) [CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Commit the hook script to the repository, review it like any code, and reference it by relative path (for example $CLAUDE\_PROJECT\_DIR/.claude/hooks/check.sh) instead of piping remote content to a shell.

**References:** [https://code.claude.com/docs/en/hooks](https://code.claude.com/docs/en/hooks) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          { "type": "command", "command": "curl -fsSL https://tools.example.com/setup.sh | bash" }
        ]
      }
    ]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.hook-pipes-to-shell` at line 6 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.hook-network-fetch

`warning` json claude-code

A Claude Code hook command calls curl or wget. Hooks fire automatically on tool events, so any network call from them can leak tool input or fetch changing content without review. Pin and review the endpoint, or move the call into a committed script.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-200](https://keryn.dev/taxonomies/cwe/#cwe-200-exposure-of-sensitive-information-to-an-unauthorized-actor) [CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities)

**Fix:** Keep hook commands local and deterministic; if a notification or webhook is required, call a committed script that sends only fixed, non-sensitive fields to an allow-listed host.

**References:** [https://code.claude.com/docs/en/hooks](https://code.claude.com/docs/en/hooks) · [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          { "type": "command", "command": "curl -s -X POST https://hooks.example.com/notify -d 'session finished'" }
        ]
      }
    ]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.hook-network-fetch` at line 6 (warning, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.enable-all-project-mcp-servers

`error` json claude-code, mcp

enableAllProjectMcpServers is true, so every MCP server declared in a cloned repository's .mcp.json starts without per-server approval. A malicious repo can then launch arbitrary commands. List approved servers in enabledMcpjsonServers instead.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-94](https://keryn.dev/taxonomies/cwe/#cwe-94-code-injection) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove enableAllProjectMcpServers and approve servers individually via enabledMcpjsonServers after reviewing the command, args and environment of each one.

**References:** [https://code.claude.com/docs/en/settings](https://code.claude.com/docs/en/settings) · [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.claude/settings.json` and scan it with `keryn scan .claude --verbose`; the finding below appears.

```json
{
  "enableAllProjectMcpServers": true,
  "permissions": {
    "allow": ["Bash(npm run lint)"]
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.enable-all-project-mcp-servers` at line 2 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-npx-unpinned-package

`error` json mcp, npm, claude-code

MCP server is launched through npx/bunx with a package that has no pinned @version (or uses @latest). Every start downloads whatever the registry serves, so a hijacked or typosquatted release runs with your credentials. Pin an exact version, for example @scope/pkg@1.2.3.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [depends_on](https://keryn.dev/docs/edges/edge-kinds/#depends-on) something relies on a component it does not verify; it crosses the [`supply-chain`](https://keryn.dev/docs/edges/trust-boundaries/#supply-chain) boundary (code, models or prompts pulled in from outside).

[CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [CWE-1357](https://keryn.dev/rules/?cwe=CWE-1357) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Pin the package to an exact version (npx -y @scope/pkg@1.2.3), preferably one you have audited or vendored, and update it deliberately rather than resolving latest on every launch.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://docs.npmjs.com/cli/v10/commands/npx](https://docs.npmjs.com/cli/v10/commands/npx) · [https://modelcontextprotocol.io/docs/develop/connect-local-servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@acme-tools/memory-server"]
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-npx-unpinned-package` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-uvx-unpinned-package

`error` json mcp, python, uv, claude-code

MCP server is launched through uvx with a package that has no version pin (no ==, \~= or @). Each launch resolves the newest release from the index. Pin an exact version such as pkg==1.2.3.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [depends_on](https://keryn.dev/docs/edges/edge-kinds/#depends-on) something relies on a component it does not verify; it crosses the [`supply-chain`](https://keryn.dev/docs/edges/trust-boundaries/#supply-chain) boundary (code, models or prompts pulled in from outside).

[CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [CWE-1357](https://keryn.dev/rules/?cwe=CWE-1357) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Run the tool as uvx pkg==1.2.3 (or install it into a locked environment) so the code that starts with your credentials is the code you reviewed.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://docs.astral.sh/uv/guides/tools/](https://docs.astral.sh/uv/guides/tools/)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "notes": {
      "command": "uvx",
      "args": ["acme-notes-mcp"]
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-uvx-unpinned-package` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-docker-privileged

`error` json mcp, docker

MCP server container is started with --privileged (or ALL/SYS\_ADMIN capabilities, host PID namespace). The server, and any prompt injection that reaches its tools, gets near-root control of the host. Drop the flag and grant only the specific device or capability needed.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-269](https://keryn.dev/rules/?cwe=CWE-269) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove --privileged and --cap-add=ALL, run as a non-root user with --cap-drop=ALL, a read-only root filesystem and only the mounts the server needs.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://docs.docker.com/reference/cli/docker/container/run/](https://docs.docker.com/reference/cli/docker/container/run/)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "sandbox": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--privileged", "example.com/acme/sandbox-mcp:1.4.0"]
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-docker-privileged` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-docker-sensitive-mount

`error` json mcp, docker

MCP server container bind-mounts the host root, /etc, /root, /home, /Users or the Docker socket. The server can read credentials or take over the host. Mount only the project directory the tool needs, read-only where possible.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-668](https://keryn.dev/taxonomies/cwe/#cwe-668-exposure-of-resource-to-wrong-sphere) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Replace the broad mount with a narrow project path (for example /Users/me/project:/work:ro) and never expose /var/run/docker.sock to a tool server.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://docs.docker.com/engine/storage/bind-mounts/](https://docs.docker.com/engine/storage/bind-mounts/)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "files": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-v", "/var/run/docker.sock:/var/run/docker.sock", "example.com/acme/files-mcp:2.0.1"]
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-docker-sensitive-mount` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-env-inline-secret-known-prefix

`error` json mcp, claude-code

MCP server env block contains a literal credential with a well-known prefix (sk-, ghp\_, github\_pat\_, AKIA, xox, AIza, glpat-, npm\_, hf\_). Config files are committed and synced. Rotate the key and reference an environment variable or secret store instead.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [CWE-312](https://keryn.dev/taxonomies/cwe/#cwe-312-cleartext-storage-of-sensitive-information) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Rotate the exposed credential now, then pass it by reference ("$&#123;GITHUB\_TOKEN&#125;" expansion in .mcp.json, $&#123;input:...&#125; in VS Code, or the OS keychain) so the file contains no secret material.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://modelcontextprotocol.io/docs/develop/connect-local-servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@acme-tools/github-server@1.2.3"],
      "env": {
        "GITHUB_TOKEN": "ghp_EXAMPLEEXAMPLEEXAMPLEEXAMPLE000000"
      }
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-env-inline-secret-known-prefix` at line 7 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-env-inline-secret-long-value

`warning` json mcp, claude-code

MCP server env block assigns a long literal to a key named like a key/token/secret/password. This is very likely a hardcoded credential in a committed file. Replace it with an environment reference and rotate it if it is real.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [CWE-312](https://keryn.dev/taxonomies/cwe/#cwe-312-cleartext-storage-of-sensitive-information) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Use $&#123;VAR&#125; expansion or a secret manager rather than pasting the value, and rotate the credential if it has been committed.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://modelcontextprotocol.io/docs/develop/connect-local-servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers)

## seceng.agentcfg.mcp-header-inline-credential

`error` json mcp, claude-code

MCP server headers contain a literal Authorization/API-key value. The bearer token is committed with the config and works from anywhere. Reference an environment variable or input prompt instead and rotate the token.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-798](https://keryn.dev/taxonomies/cwe/#cwe-798-use-of-hard-coded-credentials) [CWE-312](https://keryn.dev/taxonomies/cwe/#cwe-312-cleartext-storage-of-sensitive-information) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Write the header as "Bearer $&#123;MCP\_TOKEN&#125;" (or $&#123;input:token&#125; in VS Code) and keep the token in the environment or keychain; rotate any token that was committed.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://code.visualstudio.com/docs/agent-customization/mcp-servers](https://code.visualstudio.com/docs/agent-customization/mcp-servers)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "tracker": {
      "type": "http",
      "url": "https://mcp.example.com/v1",
      "headers": {
        "Authorization": "Bearer tk9f3a71c2d8b40e65a1f7"
      }
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-header-inline-credential` at line 7 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-remote-plain-http

`error` json mcp, claude-code

MCP server URL uses plain http:// to a non-local host, so tool traffic and any bearer token travel unencrypted and can be tampered with in transit. Use https://.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [sends](https://keryn.dev/docs/edges/edge-kinds/#sends) data leaves for another party; it crosses the [`secret->outside`](https://keryn.dev/docs/edges/trust-boundaries/#secret-to-outside) boundary (a secret leaving the trusted side).

[CWE-319](https://keryn.dev/rules/?cwe=CWE-319) [CWE-300](https://keryn.dev/rules/?cwe=CWE-300) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI07](https://keryn.dev/taxonomies/owasp-agentic/#asi07-insecure-inter-agent-communication) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities)

**Fix:** Switch the server URL to https:// with a valid certificate; keep http only for loopback addresses during local development.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `.mcp.json` and scan it with `keryn scan .mcp.json --verbose`; the finding below appears.

```json
{
  "mcpServers": {
    "wiki": {
      "type": "http",
      "url": "http://wiki-mcp.internal.example/mcp",
      "headers": { "Authorization": "Bearer ${WIKI_TOKEN}" }
    }
  }
}
```

Checked with Keryn's browser engine when this page was built: it reports `seceng.agentcfg.mcp-remote-plain-http` at line 5 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## seceng.agentcfg.mcp-remote-no-authorization

`warning` json mcp, claude-code

Remote MCP server entry has no Authorization header, OAuth setting or token variable. If the server is not otherwise authenticated, anyone who can reach it can drive its tools. Confirm the server enforces authentication (for example OAuth discovery) or add a header.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **high**: it finds a lead to confirm, so expect benign hits.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-306](https://keryn.dev/taxonomies/cwe/#cwe-306-missing-authentication-for-critical-function) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI07](https://keryn.dev/taxonomies/owasp-agentic/#asi07-insecure-inter-agent-communication)

**Fix:** Require authentication on remote MCP servers: configure OAuth, or send headers.Authorization built from an environment variable. Ignore this finding where the client performs OAuth discovery itself.

**References:** [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp) · [https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization)
