← Back to Pull requests

[api][runtime][java][python] Require HTTPS and add digest pinning for URL skill sources #1005

Closed
unknown closed this pull request without merging on Sep 09, 2026 02:57 UTC
View on GitHub
unknown unknown commented on Aug 12, 2026 19:11 UTC
Author

Purpose of change

Closes #1003.

Remote skill archives are trusted instructions and code: their SKILL.md content is consumed by the agent, and bundled scripts can become executable through the built-in tools. Until now, Skills.fromUrl(...) / Skills.from_url(...) accepted plain HTTP and extracted whatever arrived, without verifying an operator-provided integrity expectation.

This change makes URL skill sources secure by default and adds optional integrity verification across the Java, Python, and YAML surfaces.

  • Reject plain HTTP URL skill sources by default; HTTPS is required.

  • Keep plain HTTP available only through explicitly named unsafe factory methods or the allow_insecure_http YAML option.

  • Let operators pin an expected SHA-256 digest, which is verified against the downloaded archive before extraction.

  • Enforce the transport and digest rules again at runtime, so sources arriving through plan serialization or YAML cannot bypass API-level validation.

  • Reject cross-protocol redirects before requesting their targets.

  • Log sanitized configured and effective URLs when a same-protocol redirect changes the source location.

  • Clean up temporary archives on every failure path.

  • Add a structured YAML url_sources list while preserving the existing urls shorthand for unpinned HTTPS sources.

  • Validate URL sources during YAML loading so invalid transport or digest configuration fails before TaskManager execution.

  • Keep Java and Python aligned on configuration, security behavior, tests, documentation, and generated YAML schemas.
  • Existing direct and same-protocol-redirecting HTTPS sources continue to download successfully. When a same-protocol redirect changes the effective URL, both runtimes now emit a warning with sensitive URL components removed. Existing plain HTTP sources must opt in explicitly.

    Tests

  • Full Java suite (./tools/ut.sh -j) passed under JDK 17 across all 32 reactor modules.

  • Full Python non-integration suite passed: 844 passed, 13 skipped, 144 deselected.

  • Java agent-plan cross-language tests passed: 9 passed, 1 skipped.

  • Ruff passed on the changed Python files.

  • git diff --check passed.

  • Java Spotless passed under JDK 17.

  • YAML schema consistency was verified for the original schema changes, including both generated schema copies and the updated contract blob hash.

  • Apache RAT passed on the original patch.
  • API

    Yes. The Java and Python skill factories reject plain HTTP by default and provide aligned methods for SHA-256 pinning and explicit HTTP opt-in:

  • Java: fromUrlWithSha256, fromUrlUnsafe, and fromUrlUnsafeWithSha256.

  • Python: from_url_with_sha256, from_url_unsafe, and from_url_unsafe_with_sha256.
  • YAML provides a structured url_sources list whose entries accept url, optional sha256, and optional allow_insecure_http. The existing urls list remains available for ordinary HTTPS sources. Invalid URL and digest configuration is rejected during YAML loading, while runtime validation remains as defense in depth.

    Documentation

  • doc-needed

  • doc-not-needed

  • doc-included
  • Was this patch authored or co-authored using generative AI tooling?

  • Yes

  • No
  • Generated-by: OpenAI Codex (GPT-5)

    Diff: 413 lines (+309 / -104) across 5 files Reviewer: weiqingy Review duration: 39346m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 413 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.361
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1005"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.7% · Safe to merge
    17.7%