Skip to content

fix(backend): patch vulnerable langsmith dependency - #13784

Merged
ntindle merged 2 commits into
devfrom
codex/dependabot-backend-security-patches
Aug 6, 2026
Merged

fix(backend): patch vulnerable langsmith dependency#13784
ntindle merged 2 commits into
devfrom
codex/dependabot-backend-security-patches

Conversation

@ntindle

@ntindle ntindle commented Aug 6, 2026

Copy link
Copy Markdown
Member

Why / What / How

Dependabot flags the backend's LangSmith 0.7.7 dependency as vulnerable. This PR upgrades LangSmith to 0.8.18 while keeping Setuptools on the existing 80.x line because aioclamd 1.0.0 still imports pkg_resources, which Setuptools 83 removes.

The dependency constraint is updated and the Poetry lockfile is regenerated with the repository-pinned Poetry 2.2.1. The resulting lock change is limited to LangSmith metadata, its newly required websockets>=15 dependency declaration, and the content hash.

Changes 🏗️

  • Upgrade backend LangSmith from 0.7.7 to 0.8.18.
  • Regenerate the backend lockfile with Poetry 2.2.1.
  • Preserve Setuptools 80.10.2; its separate advisory requires an aioclamd-compatible remediation.
  • No environment, Docker, API schema, or runtime configuration changes.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Run poetry run format across the backend and shared libraries
    • Run poetry run poetry check --lock
    • Import LangSmith 0.8.18, its Claude Agent SDK integration, aioclamd, and Setuptools 80.10.2
    • Run poetry run pytest backend/copilot/sdk/otel_setup_test.py backend/util/virus_scanner_test.py -q (25 passed)
    • Run the repository pre-commit suite under Node 24
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

Note

Low Risk
Dependency-only security patch; LangSmith is used for copilot tracing integration and the PR author validated imports and targeted tests.

Overview
Addresses a Dependabot-reported vulnerability by bumping backend LangSmith from 0.7.7 to ^0.8.18 and regenerating poetry.lock.

Lockfile updates are limited to LangSmith’s package metadata: the resolved version, a new required websockets>=15 dependency on LangSmith (the backend already pins websockets), an extra rename from sandbox to strands-agents, and the lock content-hash. No application code, config, or API changes.

Reviewed by Cursor Bugbot for commit 2aa1ccf. Bugbot is set up for automated code reviews on this repo. Configure here.

@ntindle
ntindle requested a review from a team as a code owner August 6, 2026 05:11
@ntindle
ntindle requested review from 0ubbe and removed request for a team August 6, 2026 05:11
@ntindle
ntindle requested a review from Swiftyos August 6, 2026 05:11
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Aug 6, 2026
@github-actions github-actions Bot added cla: signed CLA signed by all contributors platform/backend AutoGPT Platform - Back end size/m labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8741490f-ca55-454c-95d9-415b58de38ca

📥 Commits

Reviewing files that changed from the base of the PR and between e521f07 and 2aa1ccf.

⛔ Files ignored due to path filters (1)
  • autogpt_platform/backend/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • autogpt_platform/backend/pyproject.toml
📜 Recent review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Seer Code Review
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Analyze (python)
  • GitHub Check: type-check (3.12)
  • GitHub Check: test (3.12)
  • GitHub Check: type-check (3.13)
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.11)
  • GitHub Check: test (3.11)
  • GitHub Check: lint
  • GitHub Check: Check PR Status
  • GitHub Check: check-overlaps
🧰 Additional context used
📓 Path-based instructions (1)
autogpt_platform/backend/**/*.{json,yaml,yml,toml,config}

📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)

Include agent configuration in dedicated configuration files

Files:

  • autogpt_platform/backend/pyproject.toml
🧠 Learnings (2)
📚 Learning: 2026-01-23T19:58:10.520Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11796
File: autogpt_platform/backend/backend/blocks/video/loop.py:80-87
Timestamp: 2026-01-23T19:58:10.520Z
Learning: Ensure MoviePy is constrained to version ^2.1.2 (2.x) in pyproject.toml files where MoviePy is declared, so the backend video processing relies on a compatible API. This should cover all relevant pyproject.toml files (e.g., autogpt_platform/backend/pyproject.toml) to maintain consistency.

Applied to files:

  • autogpt_platform/backend/pyproject.toml
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/pyproject.toml
🔇 Additional comments (1)
autogpt_platform/backend/pyproject.toml (1)

100-100: LGTM!


Walkthrough

The backend updates its langsmith dependency constraint from ^0.7.7 to ^0.8.18.

Changes

LangSmith dependency update

Layer / File(s) Summary
Update LangSmith constraint
autogpt_platform/backend/pyproject.toml
The backend dependency constraint changes from ^0.7.7 to ^0.8.18.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: 0ubbe, swiftyos, abhi1992002, pwuts

Poem

A rabbit checks the version line,
LangSmith hops to eight-oh-eight-nine?
No—eight point eighteen, crisp and new,
One tiny change in the project view.
The backend burrows on,
With outdated bounds gone.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the LangSmith dependency security update, which is the main change.
Description check ✅ Passed The description directly explains the LangSmith upgrade, lockfile regeneration, compatibility constraint, and validation performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/dependabot-backend-security-patches

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

ntindle commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

/review

@autogpt-pr-reviewer

Copy link
Copy Markdown

Queued a review for PR #13784 at 2aa1ccf.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Overlap Detection

This check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early.

🔴 Merge Conflicts Detected

The following PRs have been tested and will have merge conflicts if merged after this PR. Consider coordinating with the authors.

🟢 Low Risk — File Overlap Only

These PRs touch the same files but different sections (click to expand)

Summary: 1 conflict(s), 0 medium risk, 6 low risk (out of 7 PRs with file overlap)


Auto-generated on push. Ignores: openapi.json, lock files.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.54%. Comparing base (e521f07) to head (2aa1ccf).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #13784      +/-   ##
==========================================
+ Coverage   77.06%   77.54%   +0.48%     
==========================================
  Files        2997     2849     -148     
  Lines      227098   215401   -11697     
  Branches    21592    20567    -1025     
==========================================
- Hits       175004   167027    -7977     
+ Misses      47379    43848    -3531     
+ Partials     4715     4526     -189     
Flag Coverage Δ
forge ?
platform-backend 83.62% <ø> (+<0.01%) ⬆️
platform-frontend-e2e 30.51% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Platform Backend 83.62% <ø> (+<0.01%) ⬆️
Platform Frontend 54.94% <ø> (-0.01%) ⬇️
AutoGPT Libs ∅ <ø> (∅)
Classic AutoGPT 28.43% <ø> (-28.88%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@autogpt-pr-reviewer autogpt-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📋 Automated Review — PR #13784

PR #13784 — fix(backend): patch vulnerable langsmith dependency
Author: ntindle | Files: 2

🎯 Verdict: APPROVE

PR Description Quality

✅ Has Why + What + How — the description clearly states the why (Dependabot advisory on LangSmith 0.7.7), the what (bump to 0.8.18 + lockfile regeneration), and the how/tradeoff (Setuptools intentionally held on 80.x because aioclamd 1.0.0 still imports pkg_resources). Well-documented for future maintainers.

What This PR Does

LangSmith (used only for the copilot's Claude Agent SDK → Langfuse OTEL tracing) was pinned to a version flagged by Dependabot as vulnerable. This PR bumps the constraint to ^0.8.18 in pyproject.toml:100 and regenerates poetry.lock accordingly. There are no application code, config, API, or user-facing changes — it is a pure, single-purpose security patch.

Specialist Findings

🛡️ Security ✅ — Confirmed the bump is the intended remediation with SHA256-pinned official PyPI artifacts. The new transitive websockets>=15.0 requirement is already satisfied by the existing websockets = "^15.0" pin (pyproject.toml:81 → resolves 15.0.1), so no conflict or forced downgrade. The sandboxstrands-agents extra rename is cosmetic and uninstalled. No new attack surface.
🔵 The deferred Setuptools/aioclamd advisory remains unremediated (out of scope, documented) — worth a follow-up ticket.

🏗️ Architecture ✅ — Constraint and lockfile updated consistently (content-hash refreshed). LangSmith stays an isolated observability concern in backend/copilot/sdk/ behind a stable API (configure_claude_agent_sdk, service.py:40); the 0.7→0.8 entry points are unchanged. Zero new coupling, zero tech debt.

Performance ✅ — Dependency-only; no hot path, query, or algorithm touched. Tracing is async/batched and off the agent-execution critical path. Time/space complexity unchanged. websockets was already in the tree, so no added install-size or import-time cost.

🧪 Testing ✅ — No code changed, so no new tests are warranted. The sole integration surface is guarded by existing tests (otel_setup_test.py, incl. TestReceiveResponseCompat which asserts the exact ClaudeSDKClient.receive_response symbol LangSmith monkey-patches). The module-level import path langsmith.integrations.claude_agent_sdk is exercised at collection time — a broken path in 0.8.18 would fail the suite.

📖 Quality ✅ — Clean single-line constraint bump; lockfile machine-generated with the repo-pinned Poetry 2.2.1. No naming, structure, or maintainability surface. PR description documents the intentional Setuptools hold-back so a future reader won't "fix" it by accident.

📦 Product ✅ — Implementation matches the description exactly with no scope creep. LangSmith is internal observability only — no user-facing behavior, accessibility, or UX impact.

📬 Discussion ✅ — All bot reviews clean (CodeRabbit "no actionable comments", Cursor Bugbot Low Risk, Snyk/CodeQL/Seer passed); no open human threads. Note: overlap bot predicts a future poetry.lock/pyproject.toml merge conflict with dependabot PR #13769 — whichever merges second will need a lock regeneration.

🔎 QA ✅ — Independently verified LangSmith 0.8.18 live in both rest_server and copilot_executor, websockets 15.0.1 and setuptools 80.10.2 preserved, aioclamd/pkg_resources still imports (warning only), all copilot imports resolve, and the author's 25 tests pass on re-run. Negative/positive auth checks returned 401/401/200 as expected; no import/runtime regressions in any service log.

🟡 Nice to Have

  1. Track deferred Setuptools advisory (pyproject.toml:90) — Setuptools is intentionally held on 80.x due to aioclamd 1.0.0's pkg_resources import; a separate advisory remains open. Correctly out of scope here, but file a follow-up so it isn't lost. (Flagged by: security, architect, product, discussion — 4 specialists)
  2. Coordinate lock-ordering with PR #13769 (poetry.lock) — overlap bot predicts a future lockfile conflict with the dependabot PR; whichever merges second should regenerate the lock. (Flagged by: discussion)

Human Review Needed

NO — Dependency-only security patch touching no authentication, authorization, secret handling, or trust boundary. Scope is isolated and independently verified.

Risk Assessment

Merge risk: LOW | Rollback: EASY (revert two files)

CI Status

Local harness: ✅ All 5 checks pass (frontend lint/types/test:unit/build, backend lint). GitHub CI (per discussion specialist): 37/40 checks green, 3 pending (still running), 0 failing; reviewDecision: REVIEW_REQUIRED — needs one human approval to satisfy the branch gate before merge.


UI Testing — Variant Results

✅ local: LangSmith 0.8.18 upgrade is live in all containers with satisfied websockets>=15 and preserved setuptools 80.x; all app imports resolve, 25 cited tests pass on independent re-run, and no runtime regressions appear.

✅ hosted: LangSmith upgraded to 0.8.18 in both backend services with its new websockets>=15 dep satisfied, setuptools/aioclamd compatibility preserved, lockfile consistent, tracing path importable, and author's 25 tests reproduced green — no regressions.

@github-project-automation github-project-automation Bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Aug 6, 2026
@ntindle
ntindle added this pull request to the merge queue Aug 6, 2026
Merged via the queue into dev with commit cd09dad Aug 6, 2026
41 checks passed
@ntindle
ntindle deleted the codex/dependabot-backend-security-patches branch August 6, 2026 14:03
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed CLA signed by all contributors platform/backend AutoGPT Platform - Back end size/m

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant