Skip to content

feat(sandbox): add project-level credential deny entries#260

Merged
mrizzi merged 2 commits into
RHEcosystemAppEng:mainfrom
mrizzi:worktree-TC-5365
Jul 24, 2026
Merged

feat(sandbox): add project-level credential deny entries#260
mrizzi merged 2 commits into
RHEcosystemAppEng:mainfrom
mrizzi:worktree-TC-5365

Conversation

@mrizzi

@mrizzi mrizzi commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Create .claude/settings.json with sandbox.credentials.envVars deny entries for 16 credential env vars (GCP, Anthropic/Vertex AI, GitHub, AWS)
  • When contributors enable the sandbox via /sandbox, these vars are stripped from Bash subprocesses while Claude Code retains API access
  • Add sandbox credential isolation documentation to README.md (TC-5369)
  • Complements the CI-level sandbox credential isolation in eval-pr-run.yml by extending protection to local development

Implements TC-5365

Test plan

  • JSON validates (python3 -m json.tool .claude/settings.json)
  • All 16 env vars present with deny mode
  • JIRA_API_TOKEN absent (requires mask mode, user-level only)
  • sandbox.enabled not set (opt-in via /sandbox)
  • 2-space JSON indentation per CONVENTIONS.md
  • File tracked in git

Summary by Sourcery

Introduce a Claude sandbox settings file that enforces project-level denial of selected credential environment variables during sandboxed execution, extending credential protection to local development.

New Features:

  • Add project-level Claude sandbox configuration to deny access to common cloud and VCS credential environment variables for local runs

Enhancements:

  • Align local sandbox credential isolation with existing CI protections by centralizing deny rules in .claude/settings.json

Create .claude/settings.json with sandbox.credentials.envVars deny
entries for 16 credential env vars across GCP, Anthropic/Vertex AI,
GitHub, and AWS categories. When contributors enable the sandbox,
these vars are stripped from Bash subprocesses while Claude Code
retains access for API authentication.

JIRA_API_TOKEN intentionally omitted (requires mask mode, which is
only available in user/managed settings).

Implements TC-5365

Assisted-by: Claude Code
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

.claude/settings.json is introduced to configure sandbox credential denials for a set of sensitive environment variables so that when the sandbox is enabled, these variables are stripped from Bash subprocesses while preserving Claude Code API access, extending CI-level protections to local development.

File-Level Changes

Change Details Files
Introduce Claude sandbox settings to deny specific credential environment variables at project level.
  • Add .claude/settings.json configuration file for sandbox behavior.
  • Configure sandbox.credentials.envVars entries for 16 sensitive environment variables across GCP, Anthropic/Vertex AI, GitHub, and AWS, all using deny mode.
  • Ensure project-level sandbox configuration does not enable sandbox by default, requiring opt-in via /sandbox command.
  • Align JSON formatting and structure with existing conventions, including 2-space indentation and valid JSON syntax.
.claude/settings.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mrizzi mrizzi left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think some instructions on how to use this would help a lot.

@mrizzi

mrizzi commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

[sdlc-workflow/verify-pr] Re: @mrizzi review — Classified as code change request (upgraded from suggestion) — this matches project convention: CONVENTIONS.md §Documentation (lines 100-103) states README.md should be updated when installation steps change; adding .claude/settings.json with sandbox credential deny entries changes the contributor setup experience. Sub-task TC-5369 created to address this feedback.

@mrizzi

mrizzi commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Verification Report for TC-5365 (commit af090e0)

Check Result Details
Review Feedback WARN 1 code change request (upgraded from suggestion via CONVENTIONS.md §Documentation); sub-task TC-5369 created
Root-Cause Investigation DONE plan-feature gap (primary): missing config-directory → Documentation Updates heuristic (TC-5370); implement-task gap (secondary): README.md not checked for config-directory files (TC-5371)
Scope Containment PASS PR creates .claude/settings.json — exactly matches Files to Create
Diff Size PASS 24 lines added, 1 file — proportionate for a JSON config file
Commit Traceability PASS Commit af090e0 contains "Implements TC-5365"
Sensitive Patterns PASS No actual secrets — file contains only env var names in deny-list config
CI Status PASS All 3 CI checks passed (Sourcery, Plugin Validation, Skill Lint)
Acceptance Criteria PASS 6 of 6 criteria met
Test Quality N/A Eval Quality: N/A — no test files or eval results
Test Change Classification N/A No test files in PR diff
Verification Commands PASS Both commands succeed (JSON valid, 16 env vars with deny mode, JIRA_API_TOKEN absent)

Overall: WARN

Review feedback identified missing README.md documentation for the sandbox credential isolation feature. Sub-task TC-5369 created to add usage instructions. Root-cause analysis traced the gap to plan-feature (missing heuristic for config-directory documentation triggers) and implement-task (directory-scoped README search too narrow).


This comment was AI-generated by sdlc-workflow/verify-pr v0.13.5.

Add a Sandbox Credential Isolation section to README.md explaining
the .claude/settings.json deny entries, how to enable the sandbox
with /sandbox, verification steps, and JIRA_API_TOKEN mask mode
guidance for user-level settings.

Implements TC-5369

Assisted-by: Claude Code
@mrizzi

mrizzi commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Verification Report for TC-5365 (commit 2faa32e)

Check Result Details
Review Feedback PASS Prior code change request (TC-5369) addressed; no new unclassified feedback
Root-Cause Investigation N/A Completed in prior run (TC-5370, TC-5371 already created)
Scope Containment WARN .claude/settings.json matches task scope; README.md out-of-scope but justified (sub-task TC-5369 commit on same PR branch)
Diff Size PASS 75 lines across 2 files — proportionate
Commit Traceability PASS af090e0 → TC-5365, 2faa32e → TC-5369
Sensitive Patterns PASS No actual secrets — env var names in deny-list config and documentation text
CI Status PASS 3/3 checks passed (Sourcery, Plugin Validation, Skill Lint)
Acceptance Criteria PASS 6 of 6 criteria met
Test Quality N/A Eval Quality: N/A — no test files or eval results
Test Change Classification N/A No test files in PR diff
Verification Commands PASS Both commands succeed (JSON valid, 16 env vars with deny mode, JIRA_API_TOKEN absent)

Overall: PASS

All checks pass. The Scope Containment WARN is justified — README.md was added by sub-task TC-5369 (review feedback fix) which shares the PR branch per the Target PR flow. Prior review feedback has been fully addressed.


This comment was AI-generated by sdlc-workflow/verify-pr v0.13.5.

@mrizzi
mrizzi merged commit c4d9952 into RHEcosystemAppEng:main Jul 24, 2026
3 checks passed
@mrizzi
mrizzi deleted the worktree-TC-5365 branch July 24, 2026 15:42
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.

1 participant