summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/tests
AgeCommit message (Collapse)Author
12 dayssecurity-guidance: use the CA file macOS ships when Python has nonemhegazy/sg-macos-ca-fileClaude
A python.org Python on macOS has no CA certificates until its "Install Certificates" command is run, so every review from it failed to verify the API's certificate. Where Python's default TLS context holds no certificate at all, the plugin now adds /etc/ssl/cert.pem, the file Apple's own Python uses. Verification is unchanged. Co-authored-by: mhegazy <mhegazy@anthropic.com>
12 daysMerge pull request #7107 from anthropics/mhegazy/sg-fewer-false-pattern-warningsMohamed Hegazy
security-guidance: fewer false edit warnings on ordinary JavaScript
12 daysMerge pull request #7106 from anthropics/mhegazy/sg-edit-hook-hangMohamed Hegazy
security-guidance: edit hook no longer waits on App Installer's python alias
12 daysMerge pull request #7104 from anthropics/mhegazy/sg-line-continuationMohamed Hegazy
security-guidance: match git commit and push continued on the next line
12 daysMerge pull request #7101 from anthropics/mhegazy/sg-brace-globsMohamed Hegazy
security-guidance: custom rule globs can use braces
2026-11-13security-guidance: fewer false edit warnings on ordinary JavaScriptmhegazy/sg-fewer-false-pattern-warningsClaude
Four edit rules matched their word without looking at what stands next to it: - eval: Playwright's and Puppeteer's page.$eval('selector', function) and $$eval got the eval() warning. They run the function they are given. Left out only when the selector is a plain string and the function is written out in the call. AngularJS scope.$eval(expr) and every other $eval( still warn. - new Function: the whole word is needed, so new FunctionRegistry() is quiet. - innerHTML and outerHTML: an assignment is needed, so == and === are quiet. Nothing warns that did not warn before. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-13security-guidance: match git commit and push continued on the next linemhegazy/sg-line-continuationClaude
`git \` with `commit` or `push` on the next line started the hook, but the command patterns only allowed whitespace between the words, so nothing was reviewed. They now also allow a line continued with a backslash (Bash) or a backtick (PowerShell). Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-12Merge pull request #7093 from anthropics/mhegazy/sg-ordinary-checkoutsMohamed Hegazy
security-guidance: only run git in ordinary checkouts
2026-11-13security-guidance: edit hook no longer waits on App Installer's python aliasmhegazy/sg-edit-hook-hangMohamed Hegazy
On Windows without a packaged Python, python3 under WindowsApps is App Installer's alias, which is not a Python. The launcher started it on every hook. Starting it waits for Windows' package services, so while those are stuck every hook in every session waits with them, and the edit hook had no time limit of its own: each Edit or Write then took 600 seconds. - The launcher tells that alias by where its link leads and does not start it. Which interpreter runs the hook is unchanged. Aliases of a packaged Python are still probed. - The edit hook gets a 60 second limit. Refs #6348, #3870, #6315 Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-12security-guidance: custom rule globs can use bracesmhegazy/sg-brace-globsMohamed Hegazy
`*.{ts,tsx}` in paths or exclude_paths means either. The number of combinations is bounded, per glob and over all rules. The README lists MAX_COMMIT_REVIEWS_PER_HOUR. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-12Keep git out of folders without a .git entry on older git versionsmhegazy/sg-ordinary-checkoutsClaude
Git before 2.38 has no safe.bareRepository. Check before the prompt and Stop hooks run git, following the same search git uses to find a repository, and let a work tree kept elsewhere through core.worktree through. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-12security-guidance: only run git in ordinary checkoutsClaude
Treat a folder as a repository to run git in only when it has its own .git entry or the caller named the repository through GIT_DIR, and set safe.bareRepository=explicit on the hook's git commands. Linked worktrees and ordinary checkouts work as before. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-12security-guidance: open the review records and markers through one helpermhegazy/sg-record-filesClaude
The commit and push reviews keep two small records (sg-reviewed-shas, sg-reviewed-diffs) and one marker per commit under review (sg-inflight-<sha>) in the git directory. The plugin should only read and write files it made itself; the session state file is already written in a similar way. All three are now opened through one helper, which takes a regular file with no second hard link that is no larger than a record can be. Anything else at that path is replaced by a new file when the record is about to be written, and passed over when it is only read. A folder is left alone. The open never waits, and reads from a record are capped. Anything old at a marker's path that is not such a file, other than a folder, is removed without being opened. Three more fixes on the same lines: - sg-reviewed-shas was locked with a blocking flock just before the findings go out, so the findings waited for the lock, up to the hook's timeout. The hook now waits half a second and then appends without the lock, as it does where there is no flock. - Bytes in that record that are not text ended the push review with a traceback. They now cost only their own row. - The rewritten record was still in the buffer when the lock was released, so rows written by several sessions at once were lost. It is flushed first. Cost: in a repository copied with hard links (cp -al) the records have two names, so neither copy reads them. The first copy to write starts them afresh, and commits reviewed before the copy may be reviewed once more. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-11Merge pull request #7081 from anthropics/mhegazy/sg-one-model-settingMohamed Hegazy
security-guidance: take the review model from one place, default to the newest listed
2026-11-11Merge pull request #7076 from anthropics/mhegazy/sg-powershell-commit-hooksMohamed Hegazy
security-guidance: review commits and pushes made through the PowerShell tool
2026-11-11Merge pull request #7073 from anthropics/mhegazy/sg-pip-temp-real-dirMohamed Hegazy
security-guidance: keep the pip temp folder to a real folder of this user
2026-11-11Merge pull request #7072 from anthropics/mhegazy/sg-chained-push-reviewMohamed Hegazy
security-guidance: review what a commit-and-push command sends out beyond its own commit
2026-11-11Merge pull request #7070 from anthropics/mhegazy/sg-custom-regex-time-limitMohamed Hegazy
security-guidance: stop custom rule regexes that run too long
2026-11-11Merge pull request #7055 from anthropics/mhegazy/sg-custom-rule-globsMohamed Hegazy
security-guidance: custom rule globs can be relative to the project
2026-11-11Merge pull request #7054 from anthropics/mhegazy/sg-call-argument-scanMohamed Hegazy
security-guidance: read yaml, torch and numpy load calls across their arguments
2026-11-11Merge pull request #7056 from anthropics/mhegazy/sg-credential-host-detectionMohamed Hegazy
security-guidance: hold back a host's token by the host, not the output setting
2026-11-11Merge pull request #7051 from anthropics/mhegazy/sg-gateway-windows-cliMohamed Hegazy
security-guidance: find Claude Code for the gateway sign-in check on Windows
2026-11-11Merge pull request #7047 from anthropics/mhegazy/sg-push-merge-baseMohamed Hegazy
security-guidance: push review of a merge reviews what the push added
2026-11-11security-guidance: take the review model from one place, default to the ↵Claude
newest listed The commit reviewer asked its CLI for the opus alias, so an out-of-date CLI reviewed on an older model. It now uses the same lookup as the diff review, at medium effort, and keeps the alias when the endpoint can't list models. The retry model comes from the same lookup. Model names remain only for a direct API call when the endpoint can't list. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10Split the remaining made-up tokens in testsmhegazy/sg-custom-regex-time-limitClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: name the temp folder test for what it requiresmhegazy/sg-pip-temp-real-dirClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: review what a commit-and-push command sends out beyond ↵mhegazy/sg-chained-push-reviewClaude
its own commit Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: keep the pip temp folder to a real folder of this userClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10Read more PowerShell command shapesClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10Review commits and pushes made through the PowerShell toolClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10Keep whole fake secrets out of test sourcesClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10Stop custom rule regexes that run too longClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: hold back a host's token by the host, not the output settingmhegazy/sg-credential-host-detectionClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: custom rule globs can be relative to the projectmhegazy/sg-custom-rule-globsClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: read yaml, torch and numpy load calls across their argumentsmhegazy/sg-call-argument-scanClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-10security-guidance: pack the custom rule counts into one telemetry keymhegazy/sg-pack-custom-rule-countsClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09Merge pull request #7029 from anthropics/mhegazy/sg-project-rules-after-cdMohamed Hegazy
security-guidance: keep project rules after the session changes folder
2026-11-09Merge pull request #7050 from anthropics/mhegazy/sg-launcher-probe-envMohamed Hegazy
security-guidance: set an environment variable for the launcher's interpreter probes
2026-11-09Merge pull request #7032 from anthropics/mhegazy/sg-refused-verdict-countMohamed Hegazy
security-guidance: count reviewer verdicts the CLI refused
2026-11-09Merge pull request #7031 from anthropics/mhegazy/sg-credential-routingMohamed Hegazy
security-guidance: send a claude.ai token as a bearer, hold back a gateway's
2026-11-09Merge remote-tracking branch 'origin/main' into mhegazy/sg-gateway-windows-climhegazy/sg-gateway-windows-cliClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com> # Conflicts: # plugins/security-guidance/README.md
2026-11-09security-guidance: find Claude Code for the gateway sign-in check on WindowsClaude
In a session signed in to a Claude apps gateway the check only knew macOS and Linux paths, so Windows reviews were skipped unless SG_AGENTIC_CLI_PATH was set. Look at the native installer's claude.exe too. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09security-guidance: keep the user's own rules out of the commit count testsmhegazy/sg-custom-rule-countsMohamed Hegazy
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09Merge mainMohamed Hegazy
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09Merge pull request #7033 from anthropics/mhegazy/sg-unseen-commit-countMohamed Hegazy
security-guidance: count commits that no commit hook saw
2026-11-09Merge pull request #6921 from anthropics/mhegazy/sg-reviewer-oauth-tokenMohamed Hegazy
security-guidance: stop the commit reviewer renewing a stored login
2026-11-09Merge pull request #6838 from anthropics/mhegazy/sg-stop-finding-names-unwrittenMohamed Hegazy
security-guidance: say when a Stop finding is in a file the session has no record of editing
2026-11-09security-guidance: test merges must stop on a real conflictmhegazy/sg-push-merge-baseClaude
Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09security-guidance: tests read the session state file by nameMohamed Hegazy
The test helper opened the first JSON file in the state directory, which can be the review model cache depending on directory order. Select the session state file by its prefix and require exactly one. Co-authored-by: mhegazy <mhegazy@anthropic.com>
2026-11-09security-guidance: keep the user's own rules out of the custom rule testsMohamed Hegazy
Co-authored-by: mhegazy <mhegazy@anthropic.com>