Skip to content

feat: add optional pi agent SDK support - #29

Merged
matallui merged 6 commits into
mainfrom
feat/pi-agent-sdk
Sep 10, 2026
Merged

matallui merged 6 commits into
mainfrom
feat/pi-agent-sdk

Conversation

@matallui

@matallui matallui commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional pi Agent SDK adapter for isolated LiteLLM coding and evaluation runs, using #25 as a reference.

  • Keeps Claude as the default and preserves existing Claude callers and custom adapters' Claude judge fallback.
  • Adds provider-specific option types and createPiAdapter().
  • Shares pi session setup, event normalization, and lifecycle handling between direct and Docker execution.
  • Supports turn limits, cancellation, credential scrubbing, and cost reporting that distinguishes unknown pricing from zero.
  • Supports pi judging inside the runner's configured sandbox, with only the terminating structured judgment tool enabled.
  • Pins pi to 0.83.0 as an optional peer dependency. Claude-only installations retain Node 20 support; pi execution requires Node >=22.19.0.

Pi runs are LiteLLM-only, use fresh in-memory sessions, and do not discover local settings, extensions, skills, or context files. Unsupported Claude permission options fail explicitly. Persistence, resume, custom tools, and native pi providers/OAuth are out of scope.

Validation

  • yarn build, yarn typecheck, yarn lint, and yarn test pass.
  • 602 tests pass on supported pi runtimes; coverage thresholds pass unchanged.
  • Node 20 compatibility suite passes, with SDK integration tests skipped and full coverage measured on supported pi runtimes.
  • Real Docker execution and judging pass against a local mock LiteLLM endpoint, without external model credentials.
  • Package checks pass for CJS and ESM. Verified imports and runner construction from a clean installation without pi, including Node 20.

Coverage auto-update is disabled so tests no longer modify the working tree.

Review notes

Dependency security review is still required. This PR does not waive Socket alerts or enable dependency install scripts.

- Rebuild scrubbed DOMExceptions so OTel span finalization cannot throw on abort
- Scrub only credential values of at least eight characters
- Own the settingSources default in the Claude adapter, not the runner
- Collapse the Pi SDK version to one constant and drop dead resolveBridgeSdkVersion
- Add an explicit hostRoot to bridge runtime descriptors
- Unify on-success cleanup: keep the container unless the run completed successfully
- Wrap runtime file copies in Docker error handling; write missing JSDoc
- Cover the credential scrubber sort comparator with an explicit
  multi-value test: it previously only ran when the ambient environment
  contained two or more credential-like variables, which is true on
  developer machines but not on CI runners, dropping functions coverage
  to 97.97% and failing the 98.31% threshold.
- Cover the Claude adapter getRunMetadata used for telemetry.
- Require toolCall input presence when validating pi bridge messages so
  consumers never see ToolCall objects without their required field.
- Document that runAgent/judge signal cancellation is pi-only.
@socket-security

socket-security Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​earendil-works/​pi-coding-agent@​0.83.06710010098100

View full report

@socket-security

socket-security Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Install-time scripts: npm @google/genai during preinstall

Install script: preinstall

Source: echo 'preinstall: no-op'

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@google/genai@1.52.0

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@google/genai@1.52.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @google/genai in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@google/genai@1.52.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@google/genai@1.52.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @mistralai/mistralai in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@mistralai/mistralai@2.2.6

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@mistralai/mistralai@2.2.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/credential-provider-imds in module node:http

Module: node:http

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/credential-provider-imds@4.5.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/credential-provider-imds@4.5.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/fetch-http-handler in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/fetch-http-handler@5.8.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/fetch-http-handler@5.8.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/node-http-handler in module node:https

Module: node:https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/node-http-handler@4.12.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/node-http-handler@4.12.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/node-http-handler in module node:http2

Module: node:http2

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/node-http-handler@4.12.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/node-http-handler@4.12.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/node-http-handler in module node:http

Module: node:http

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/node-http-handler@4.12.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/node-http-handler@4.12.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/node-http-handler in module node:https

Module: node:https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/node-http-handler@4.7.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/node-http-handler@4.7.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @smithy/node-http-handler in module node:http2

Module: node:http2

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/@smithy/node-http-handler@4.7.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@smithy/node-http-handler@4.7.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm agent-base in module http

Module: http

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/agent-base@7.1.4

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/agent-base@7.1.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm agent-base in module https

Module: https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/agent-base@7.1.4

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/agent-base@7.1.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm agent-base in module net

Module: net

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/agent-base@7.1.4

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/agent-base@7.1.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm formdata-polyfill in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/formdata-polyfill@4.0.10

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/formdata-polyfill@4.0.10. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm gaxios in module https

Module: https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/gaxios@7.3.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/gaxios@7.3.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm gaxios in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/gaxios@7.3.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/gaxios@7.3.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm http-proxy-agent in module net

Module: net

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/http-proxy-agent@7.0.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/http-proxy-agent@7.0.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm http-proxy-agent in module tls

Module: tls

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/http-proxy-agent@7.0.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/http-proxy-agent@7.0.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm https-proxy-agent in module net

Module: net

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/https-proxy-agent@7.0.6

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/https-proxy-agent@7.0.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm https-proxy-agent in module tls

Module: tls

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/https-proxy-agent@7.0.6

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/https-proxy-agent@7.0.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm node-fetch in module node:http

Module: node:http

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/node-fetch@3.3.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-fetch@3.3.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm node-fetch in module node:https

Module: node:https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/node-fetch@3.3.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-fetch@3.3.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm node-fetch in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/node-fetch@3.3.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-fetch@3.3.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm node-fetch in module node:net

Module: node:net

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/node-fetch@3.3.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-fetch@3.3.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm ws in module http

Module: http

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/ws@8.21.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ws@8.21.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm ws in module https

Module: https

Location: Package overview

From: package.json → npm/@earendil-works/pi-coding-agent@0.83.0 → npm/ws@8.21.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ws@8.21.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

See 52 more rows in the dashboard

Ignoring alerts on:

  • @earendil-works/pi-coding-agent@0.83.0
  • @earendil-works/pi-agent-core@0.83.0
  • @earendil-works/pi-tui@0.83.0
  • @mariozechner/clipboard@0.3.9
  • @anthropic-ai/sdk@0.91.1
  • google-auth-library@10.9.1
  • @aws-sdk/credential-provider-process@3.972.70
  • jwa@2.0.1

View full report

@matallui

matallui commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

QA Report — functional validation of the pi adapter

Validated the built artifact (dist/) from external scripts against the real LiteLLM proxy (glm-5p3-flash) and real Docker — not just the repo test suite. All scenarios passed.

Results

# Scenario Result
1 Repo gates (build, typecheck, lint, test) ✅ 602 tests, 98.3% stmts, CJS/ESM types clean
2 Option validation ✅ 16/16 — Claude permission options (permissionMode, allowedTools, settingSources, hooks) all fail explicitly; all shape errors correct
3 Direct smoke run ✅ init → generation → result; litellm/glm-5p3-flash naming; usage/turns/duration populated; no files created in cwd (isolation claim holds)
4 Cost semantics ✅ Unknown pricing → costUsd absent; zero pricing → costUsd === 0 present. Math exact: 444 in × $0.15/M + 24 out × $0.50/M = $0.0000786
5 Tools + credential scrubbing ✅ bash tool executed; decoy env secret echoed by the model came back as [REDACTED] — no leak anywhere in the message stream
6 maxTurns ✅ forced tool-loop run aborted at the limit: success:false, "Pi reached maxTurns (1)."
7 Cancellation ✅ AbortSignal killed a 30s tool run in 1.5s, threw AbortError, no result message, clean teardown
8 Structured judging (direct) ✅ submit_judgment constrained tool captured a schema-valid {score, rationale} judgment in 1 turn, cost reported
9 Runner integration ✅ createAgentRunner + runAgent (file written via tool loop) + runner.judge with pi judge — scores clamped, telemetry off by default
10 Docker sandbox (real) ✅ Task ran in the container, file crossed the workspace mount to the host, pi judge ran inside the sandbox, cleanup:'always' left zero containers
11 Clean install, no pi SDK ✅ Packed tarball into a fresh consumer: Node 24 → explicit env error; Node 20 → "Pi requires Node.js >=22.19.0. Claude-only runs still support Node 20."; Node 22 + env set → "Could not load pi. Install @earendil-works/pi-coding-agent@0.83.0…"

Notes

  • Model naming: the proxy's model id is glm-5p3-flash — the litellm/ prefix is pi's provider name, added by the adapter (init.model === "litellm/glm-5p3-flash"). Passing litellm/glm-5p3-flash as options.model would be rejected by the proxy (verified).
  • Minor observation, not a bug: on a supported Node without pi installed, the missing-env error surfaces before the missing-SDK error (env is validated before the dynamic import) — ordering seems reasonable.
  • Not covered (per PR scope): dependency security review (explicitly still open per the PR description) and Langfuse telemetry-enabled flows (no Langfuse backend exercised; the disabled-default path is verified).

Environment: Node 24.18.0, yarn 4.16.0, Docker 29.7.2, @earendil-works/pi-coding-agent@0.83.0, LiteLLM proxy litellm.consensys.info.

itsyoboieltr
itsyoboieltr previously approved these changes Sep 9, 2026

@itsyoboieltr itsyoboieltr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@matallui
matallui removed the request for review from cryptotavares September 10, 2026 07:03
@matallui

Copy link
Copy Markdown
Collaborator Author

@SocketSecurity ignore npm/@anthropic-ai/sdk@0.91.1 npm/@aws-sdk/credential-provider-process@3.972.70 npm/@earendil-works/pi-agent-core@0.83.0 npm/@earendil-works/pi-coding-agent@0.83.0 npm/@earendil-works/pi-tui@0.83.0 npm/@mariozechner/clipboard@0.3.9 npm/google-auth-library@10.9.1 npm/jwa@2.0.1

Triage notes (package-specific ignores only — no ignore-all):

All blocking alerts trace to dependencies of @earendil-works/pi-coding-agent@0.83.0 — the optional pi SDK adapter this PR pins as an optional peer dependency — and its transitive model SDK clients.

  • @earendil-works/pi-coding-agent@0.83.0, @earendil-works/pi-agent-core@0.83.0, @earendil-works/pi-tui@0.83.0: the pi coding-agent SDK itself. The flagged shell access (child_process) and network access are inherent, by-design capabilities of a coding agent (executing commands, calling model APIs), not indicators of malicious behavior. This PR bounds the exposure: pi runs are LiteLLM-only with fresh in-memory sessions, execute inside the runner's configured sandbox, and pi judging exposes only a single terminating structured judgment tool. All three packages are pinned to exactly 0.83.0.
  • @anthropic-ai/sdk@0.91.1: official Anthropic SDK (transitive via pi); the flagged network access is its core function. The AI signal about npx/.tgz delegation refers to Claude Agent SDK tooling, not a code path this repo exercises.
  • @aws-sdk/credential-provider-process@3.972.70: official AWS SDK package; spawning a user-configured credential helper process is its documented purpose.
  • @mariozechner/clipboard@0.3.9: pi's clipboard helper; reads/writes the system clipboard via platform shell utilities — its sole function.
  • google-auth-library@10.9.1: Google's official auth client (transitive of pi's Google provider support).
  • jwa@2.0.1: verified on npm — panva (maintainer of jose/openid-client, widely trusted in the JWT ecosystem) was added as maintainer alongside the existing omsmith/Auth0 maintainers. A legitimate maintenance addition, not a takeover.

The remaining Warn-level alerts (network access for model SDK clients, the @google/genai preinstall script, published npm-shrinkwrap) are informational and non-blocking, so no ignore was added for them.

@matallui
matallui merged commit 804e460 into main Sep 10, 2026
33 checks passed
@matallui
matallui deleted the feat/pi-agent-sdk branch September 10, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants