Claude Agent Sdk

WarnAudited by ClawScan on May 10, 2026.

Overview

This is mostly a Claude Agent SDK reference, but an included MCP template appears to evaluate an agent-supplied expression as code, which should be reviewed before use.

Review the templates before copying them into a project, especially `templates/custom-mcp-server.ts`. Avoid any eval-based tool, keep permissions narrow, protect API keys and session IDs, and connect agents only to trusted MCP servers.

Findings (5)

Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.

What this means

Using this template as-is could let an agent execute unintended JavaScript in your local or server environment.

Why it was flagged

The supplied static scan reports a custom MCP template evaluating a tool argument as JavaScript. In an agent tool, that argument may be influenced by the model or user, creating arbitrary code execution risk if the template is copied or run.

Skill content
const result = eval(args.expression);
Recommendation

Do not use the eval-based template unchanged. Replace it with explicit safe functions, a restricted expression parser, strong input validation, and sandboxing if code execution is truly required.

What this means

If copied into the wrong environment, agent workflows could modify files or run shell commands without normal approvals.

Why it was flagged

The skill documents high-impact permission modes. It also clearly labels bypass mode as dangerous and recommends sandboxed use, so this is purpose-aligned but important for users to notice.

Skill content
`bypassPermissions` ... "Auto-approves EVERYTHING: All file operations, All bash commands, All tools"
Recommendation

Prefer default permissions, narrow `allowedTools`, use `canUseTool` checks, and reserve `bypassPermissions` for isolated containers or CI environments.

What this means

Leaking or mishandling the API key could expose your Anthropic account or incur usage charges.

Why it was flagged

The SDK examples require an Anthropic API key. This is expected for the stated purpose, but the key grants account and billing access.

Skill content
export ANTHROPIC_API_KEY="sk-ant-..."
Recommendation

Store API keys in environment variables or a secrets manager, avoid committing them, and use the least-privileged credential available.

What this means

Sensitive prompts, code, or decisions may persist across resumed sessions if users store and reuse session IDs carelessly.

Why it was flagged

The skill teaches session persistence and session ID storage. This is central to SDK session management, but preserved context can include sensitive data or stale instructions.

Skill content
"Persistent conversations" ... "Agent remembers everything" ... "Store session IDs for later use"
Recommendation

Protect session IDs, avoid placing secrets in prompts, and start a fresh session when switching trust boundaries or unrelated tasks.

What this means

A misconfigured or untrusted MCP server could receive tool requests or credentials intended for another service.

Why it was flagged

The skill documents remote MCP server connections with authorization headers. This is expected for MCP integrations, but it creates a trust boundary with an external tool server.

Skill content
url: "https://api.example.com/mcp", headers: { "Authorization": "Bearer token" }
Recommendation

Use only trusted MCP servers, scope tokens narrowly, verify endpoints, and whitelist the specific MCP tools an agent may call.