Skip to content

Add secrets staging workflow and browser capture pattern#36

Merged
VdustR merged 2 commits intomainfrom
feat/secrets-staging-workflow
Feb 24, 2026
Merged

Add secrets staging workflow and browser capture pattern#36
VdustR merged 2 commits intomainfrom
feat/secrets-staging-workflow

Conversation

@VdustR
Copy link
Owner

@VdustR VdustR commented Feb 24, 2026

Summary

  • Add AI-Generated Secrets (Staging Workflow) subsection: secure $TMPDIR-based intermediate layer for AI-obtained tokens, with conflict detection (4 options) and persist-with-comment format
  • Add Browser-Extracted Values (Capture Functions) subsection: inline _capture() pattern ensuring browser-sourced values never appear as raw literals
  • Update PROHIBITED section: add staging file as the only allowed intermediate file exception

Test plan

  • Verified staging workflow commands execute correctly (umask 077, write, source, length check, cleanup)
  • Review section ordering: Verifying → Writing → Staging → Browser → Reloading → PROHIBITED
  • Review conflict detection table renders correctly in Markdown

🤖 Generated with Claude Code

Add two new subsections to Secrets Handling:
- AI-Generated Secrets (Staging Workflow): secure intermediate layer
  using $TMPDIR for AI-obtained tokens before persisting to ~/.secrets
- Browser-Extracted Values (Capture Functions): inline _capture()
  pattern ensuring browser-sourced values never appear as raw literals

Update PROHIBITED section with staging file exception.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: a2f4266

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @VdustR, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the secure handling of sensitive information within the Claude Code environment. It introduces a robust staging workflow for AI-generated secrets, ensuring they are managed securely with conflict detection before persistence. Additionally, it establishes a pattern for safely capturing browser-extracted values, preventing their exposure as raw literals. These changes collectively strengthen the overall security posture by providing clear guidelines and mechanisms for managing sensitive data.

Highlights

  • AI-Generated Secrets (Staging Workflow): Introduced a secure, $TMPDIR-based intermediate layer for AI-obtained tokens, including conflict detection with four options and a persist-with-comment format.
  • Browser-Extracted Values (Capture Functions): Added an inline _capture() pattern to ensure browser-sourced values never appear as raw literals, promoting secure handling.
  • PROHIBITED Section Update: Updated the PROHIBITED section to explicitly allow the staging file as the only permitted intermediate file exception for sensitive data.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .claude/CLAUDE.md
    • Added detailed documentation for the AI-Generated Secrets (Staging Workflow), outlining the staging directory, file, secret acquisition steps, conflict detection, and persistence format.
    • Included documentation for Browser-Extracted Values (Capture Functions), defining the capture pattern and key principles for secure handling.
    • Updated the PROHIBITED section to include an exception for the newly introduced staging file.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new staging workflow for secrets and a capture pattern for browser-extracted values, which are good additions for improving security. My review identified a critical command injection vulnerability in the proposed _capture function and a bug in the conflict detection logic that could lead to incorrect behavior. I've provided specific suggestions to address these issues.

Review-loop iteration 1 (HIGH):
- Use printf %q instead of echo for shell-safe value quoting in
  staging step 2 and _capture function
- Fix override example key name consistency (OLD_KEY → KEY)
- Add failure handling instruction to source step

Review-loop iteration 2 (MEDIUM/LOW):
- Add cleanup instruction for declined-persist path
- Reorder conflict options table: Override (default) first

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@VdustR VdustR merged commit 5d6e650 into main Feb 24, 2026
@VdustR VdustR deleted the feat/secrets-staging-workflow branch February 24, 2026 05:17
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