Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Jan 8, 2026

This PR improves the security of the CLI by suppressing stack traces in default error output, which could otherwise leak file paths and internal details. It specifically addresses unhandled JSON.parse exceptions when parsing user-provided options. Stack traces are now only shown when DEBUG environment variable is set. Also adds a journal entry for Sentinel.


PR created automatically by Jules for task 18137053398840985219 started by @srod


Summary by cubic

Improve CLI security by hiding stack traces by default and safely parsing JSON options. This prevents leaking internal paths and details; stack traces show only when DEBUG is set.

  • Bug Fixes

    • Wrap JSON.parse in parseOptions to throw a clean “Invalid JSON options” error.
    • Suppress stack traces in default CLI error output; print full errors only with DEBUG.
    • Style errors with chalk for clearer messages.
  • New Features

    • Add Sentinel security journal template (.jules/sentinel.md) to capture critical security learnings.

Written for commit 13891b8. Summary will update on new commits.

@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 13891b8

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

- Wrap `JSON.parse` in `packages/cli` with safe error handling to prevent raw stack traces on invalid JSON input.
- Modify `packages/cli` entry point to suppress stack traces for known errors unless `DEBUG` env var is set.
- Add `chalk` styling to error messages for better readability.
- Create `.jules/sentinel.md` to record security learnings.

Fixes Medium Priority Issue: Missing error handling exposing stack traces.
@srod srod force-pushed the sentinel-cli-error-handling-18137053398840985219 branch from 888f7ba to 13891b8 Compare January 9, 2026 07:58
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.36%. Comparing base (309af80) to head (13891b8).

Files with missing lines Patch % Lines
packages/cli/src/index.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2755      +/-   ##
===========================================
- Coverage    99.54%   99.36%   -0.18%     
===========================================
  Files           58       58              
  Lines         1105     1110       +5     
  Branches       335      336       +1     
===========================================
+ Hits          1100     1103       +3     
- Misses           5        7       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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