Is @anthropic-ai/sdk safe?
- Node.js shell/command execution
- Node.js filesystem read
- Node.js filesystem write/delete
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
@anthropic-ai/sdk is an npm package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators. It can: filesystem read, filesystem write, network egress, scoped identity and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 0/100 (low).
@anthropic-ai/sdk 0.131.0
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of @anthropic-ai/sdk's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (5)
The component can run operating-system commands or spawn processes.
import * as child_process from 'node:child_process';
const child_process = tslib_1.__importStar(require("node:child_process"));import * as child_process from 'node:child_process';
import * as child_process from 'node:child_process';
import * as cp from 'node:child_process';
* across exec() calls. Uses pipes rather than a PTY so input is never echoed.
this.#proc = cp.spawn('/bin/bash', ['--noprofile', '--norc'], {async exec(
const proc = cp.spawn(rg, ['-n', '--no-heading', '-e', pattern, '--', searchPath], {const cp = tslib_1.__importStar(require("node:child_process"));* across exec() calls. Uses pipes rather than a PTY so input is never echoed.
async exec(command, opts = {}) {import * as cp from 'node:child_process';
* across exec() calls. Uses pipes rather than a PTY so input is never echoed.
* across exec() calls. Uses pipes rather than a PTY so input is never echoed.
__classPrivateFieldSet(this, _BashSession_proc, cp.spawn('/bin/bash', ['--noprofile', '--norc'], {async exec(command, opts = {}) {const proc = cp.spawn(rg, ['-n', '--no-heading', '-e', pattern, '--', searchPath], {Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; prefer execFile with an argument array.
The component reads files from disk.
* the result of fs.createReadStream().
* file: fs.createReadStream('path/to/file'),* file: fs.createReadStream('path/to/file'),* file: fs.createReadStream('path/to/file'),* { archive: fs.createReadStream('path/to/file') },* { archive: fs.createReadStream('path/to/file') },* { archive: fs.createReadStream('path/to/file') },* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* { files: [fs.createReadStream('path/to/file')] },* { files: [fs.createReadStream('path/to/file')] },* { files: [fs.createReadStream('path/to/file')] },* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* file: fs.createReadStream('path/to/file'),* file: fs.createReadStream('path/to/file'),* file: fs.createReadStream('path/to/file'),* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],* files: [fs.createReadStream('path/to/file')],Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
await fs.unlink(tempPath).catch(() => {});await fs.rm(dest, { recursive: true, force: true });await fs.rm(dest, { recursive: true, force: true }).catch((e) => {await fs.rm(tmp, { force: true });await fs.rm(excludeFile, { force: true });await fs.rm(stage, { recursive: true, force: true });await fs.writeFile(excludeFile, patterns.join('\n') + '\n', { flag: 'wx', mode: 0o600 });await fs.unlink(tempPath).catch(() => {});await fs.rm(fullPath, { recursive: true, force: false });await fs.unlink(tempPath).catch(() => { });await fs.unlink(tempPath).catch(() => { });await fs.rm(dest, { recursive: true, force: true });await fs.rm(dest, { recursive: true, force: true }).catch((e) => {await node_1.stream.promises.pipeline(node_1.stream.Readable.fromWeb(resp.body), node_1.fs.createWriteStream(tmp));
await fs.rm(tmp, { force: true });await fs.rm(excludeFile, { force: true });await fs.rm(stage, { recursive: true, force: true });await fs.writeFile(excludeFile, patterns.join('\n') + '\n', { flag: 'wx', mode: 0o600 });await fs.rm(dest, { recursive: true, force: true });await fs.rm(dest, { recursive: true, force: true }).catch((e) => {await fs.rm(tmp, { force: true });await fs.rm(excludeFile, { force: true });await fs.rm(stage, { recursive: true, force: true });await fs.writeFile(excludeFile, patterns.join('\n') + '\n', { flag: 'wx', mode: 0o600 });await fs.unlink(tempPath).catch(() => { });Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
* timeout/abort errors, errors thrown by `fetch()`, and `APIConnectionError`s
// Expo fetch
('message' in err && String(err.message).includes('FetchRequestCanceledException'))));// Expo fetch
('message' in err && String(err.message).includes('FetchRequestCanceledException'))));: (await fetch('data:,')).constructor);: (await fetch('data:,')).constructor);resp = await config.fetch(url, {resp = await config.fetch(url, {resp = await config.fetch(url, {resp = await config.fetch(url, {* timeout/abort errors, errors thrown by `fetch()`, and `APIConnectionError`s
// Expo fetch
('message' in err && String((err as any).message).includes('FetchRequestCanceledException'))): (await fetch('data:,')).constructor) as typeof Response;resp = await config.fetch(url, {resp = await config.fetch(url, {Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
A short-lived, scoped, assumed identity was detected — an STS AssumeRole / session token, a cloud managed or workload identity, an impersonated service account, a projected Kubernetes service-account token, or a dynamic-secret broker. Tools authenticate with a narrowly-scoped credential that expires, rather than a long-lived embedded service credential. (6 occurrence(s) shown as evidence).
* An {@link AccessTokenProvider} for OAuth/workload-identity authentication.* creator is not recorded (legacy, workload-identity-federated, or system-created
* creator is not recorded (legacy, workload-identity-federated, or system-created
* An {@link AccessTokenProvider} for OAuth/workload-identity authentication.* creator is not recorded (legacy, workload-identity-federated, or system-created
* creator is not recorded (legacy, workload-identity-federated, or system-created
Fix: A scoped, short-lived identity is the smallest-blast-radius execution context. Confirm the assumed role / requested scope grants only the permissions the tool needs, and that the token lifetime is minimal.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in @anthropic-ai/sdk.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →