Repository navigation
ci: add loop observability + mirror inspection tools to implement agent #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,7 +106,7 @@ jobs: | |
| claude_args: | | ||
| --max-turns 150 | ||
| --model claude-sonnet-5 | ||
| --allowedTools "Bash(pnpm install:*),Bash(pnpm run:*),Bash(pnpm test:*),Bash(pnpm exec:*),Bash(pnpm --filter:*),Bash(pnpm ls:*),Bash(pnpm why:*),Bash(node:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git checkout:*),Bash(git switch:*),Bash(git branch:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git config:*),Bash(mkdir:*),Bash(gh issue view:*),Bash(gh issue comment:*),Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr edit:*),Bash(gh pr diff:*),Bash(gh pr checks:*)" | ||
| --allowedTools "Bash(pnpm install:*),Bash(pnpm run:*),Bash(pnpm test:*),Bash(pnpm exec:*),Bash(pnpm --filter:*),Bash(pnpm ls:*),Bash(pnpm why:*),Bash(node:*),Bash(rg:*),Bash(grep:*),Bash(cat:*),Bash(sed:*),Bash(ls:*),Bash(head:*),Bash(tail:*),Bash(wc:*),Bash(find:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git checkout:*),Bash(git switch:*),Bash(git branch:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git config:*),Bash(mkdir:*),Bash(gh issue view:*),Bash(gh issue comment:*),Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr edit:*),Bash(gh pr diff:*),Bash(gh pr checks:*)" | ||
| prompt: | | ||
| REPO: ${{ github.repository }} | ||
| ISSUE NUMBER: ${{ github.event.issue.number }} | ||
|
|
@@ -174,6 +174,20 @@ jobs: | |
| to main, and never write "@claude" or "@coderabbitai" in any | ||
| comment, commit message, or PR text. | ||
|
|
||
| # Observability: the action writes a full turn-by-turn stream (every | ||
| # tool call, and every permission denial) to this file. Upload it so a | ||
| # failed/thrashing run is diagnosable after the fact — the Actions log | ||
| # itself only carries the init + final result. `always()` so it is kept | ||
| # even when the Claude step fails (exactly when it is needed). | ||
| - name: Upload Claude execution log | ||
| if: always() && steps.perm.outputs.allowed == 'true' | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | ||
| with: | ||
| name: claude-implement-log-${{ github.event.issue.number }} | ||
| path: ${{ runner.temp }}/claude-execution-output.json | ||
| if-no-files-found: ignore | ||
| retention-days: 14 | ||
|
|
||
|
Comment on lines
+177
to
+190
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🌐 Web query:
💡 Result: Claude Code does not have a native, built-in feature to automatically redact secrets or mask sensitive data from tool execution outputs [1][2][3]. By default, raw output from tools like Bash, Read, or Grep is stored verbatim in the conversation context and remains accessible for the duration of the session, including in any shared transcripts [1][2]. Because Claude Code relies on the harness to manage tool execution, sensitive data that enters the context window is permanent and cannot be removed or redacted by the model itself [2]. To address this, the community has developed several third-party hooks and filtering tools that operate by intercepting tool calls or outputs [4][5][6][7][8]. Key Approaches for Redaction and Security: 1. Permission Rules (Official): The primary built-in mechanism is to use strict permission settings to prevent Claude Code from accessing sensitive files or running risky commands altogether [9][10][11]. You can use the Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate the workflow and any references to the execution log artifact or the Claude action.
git ls-files | rg -n '(^|/)(claude-implement\.yml|.*claude.*|.*execution.*|README\.md|docs/|\.github/workflows/)'
printf '\n--- matches for execution-output ---\n'
rg -n "claude-execution-output|execution output|turn-by-turn|permission denial|Upload Claude execution log|always\(\).*allowed == 'true'" .github/workflows README.md docs . 2>/dev/null || true
printf '\n--- workflow excerpt around artifact upload ---\n'
sed -n '150,210p' .github/workflows/claude-implement.ymlRepository: allxsmith/bestax Length of output: 16538 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n--- claude-implement.yml top section ---\n'
sed -n '1,170p' .github/workflows/claude-implement.yml
printf '\n--- exact action references in claude workflows ---\n'
rg -n "uses: .*claude|claude-execution-output|execution-output|mask|redact|secret" .github/workflows/claude-implement.yml .github/workflows/claude-pr-loop.yml .github/workflows/claude-review.yml .github/workflows/claude.yml
printf '\n--- docs references for the action or log file ---\n'
rg -n "claude-execution-output|redact|mask|secret|artifact|upload-artifact|claude-code-action|anthropics/claude" README.md docs .github 2>/dev/null || trueRepository: allxsmith/bestax Length of output: 18045 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the workflow and any adjacent evidence of redaction/masking.
sed -n '1,170p' .github/workflows/claude-implement.yml
printf '\n---\n'
rg -n "uses: .*claude|claude-execution-output|execution-output|mask|redact|secret" .github/workflows/claude-implement.yml .github/workflows/claude-pr-loop.yml .github/workflows/claude-review.yml .github/workflows/claude.yml
printf '\n---\n'
rg -n "claude-execution-output|redact|mask|secret|artifact|upload-artifact|claude-code-action|anthropics/claude" README.md docs .github 2>/dev/null || trueRepository: allxsmith/bestax Length of output: 17908 🌐 Web query:
💡 Result: As of July 2026, Claude Code does not have a native, built-in, or automatic system to redact sensitive information (such as API keys, secrets, or credentials) from tool execution outputs, conversation transcripts, or logs [1][2][3][4]. When Claude Code executes tools—particularly the Bash tool—it captures and stores the raw, verbatim output in the conversation history and persists it to disk (e.g., in Citations:
Execution log artifact can expose secrets 🤖 Prompt for AI Agents |
||
| # Optional second reviewer (repo variable AI_LOOP_COPILOT=true). | ||
| # Copilot's automatic-review ruleset skips bot-authored PRs on personal | ||
| # repos, so the review must be requested explicitly. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
claude code allowedTools Bash prefix matching how permission patterns match commands💡 Result:
In Claude Code, the Bash tool uses permission rules based on shell-style glob pattern matching [1][2]. These rules govern whether commands are allowed or denied and rely on specific syntax to determine how command strings are matched [3][4]. Key mechanisms for Bash permission patterns include: General Syntax and Glob Matching Rules use the format Bash(pattern), where the pattern is a glob applied to the full command string [4][2]. Wildcards () can be placed at the beginning, middle, or end of the command string to allow or deny groups of commands [1][3]. Prefix Matching and Word Boundaries The presence or absence of a space before an asterisk is critical for how patterns match commands [1][3]: - Bash(ls ) (with a space): This enforces a word boundary, meaning it matches commands that start exactly with the prefix followed by a space or end-of-string [1]. For instance, Bash(ls ) matches ls -la but does not match lsof [1][3]. - Bash(ls) (no space): This performs a standard prefix match and does not enforce a word boundary [1]. Consequently, Bash(ls) matches both ls -la and lsof [1][3]. Special Suffixes The: suffix is functionally equivalent to a trailing space plus an asterisk (e.g., Bash(ls:*) is equivalent to Bash(ls *)) [1]. It is specifically recognized as a shorthand when placed at the end of a pattern [1][5]. Precedence and Behavior - Evaluation Order: Rules are evaluated in the order: deny, then ask, then allow [3]. A match in the deny list takes precedence over everything else and will block a command regardless of other settings [3][4]. - Command Parsing: Claude Code parses compound commands [3]. Each subcommand in a chain (e.g., cmd1 && cmd2) must match the permission rules independently; a rule that permits one command will not automatically permit subcommands within the same line [3]. - Fixed Wrappers: Claude Code automatically strips certain command wrappers (such as timeout, time, nice, nohup, and stdbuf) before evaluating permission matches [3]. This ensures that adding a wrapper does not circumvent established security rules [3]. Permission rules can be configured in settings files (e.g., ~/.claude.json), via CLI flags like --allowedTools or --disallowedTools, or through the Agent SDK [6][7][8]. Bare tool names (e.g., Bash) without a pattern match all calls to that tool [4][2].
Citations:
🏁 Script executed:
Repository: allxsmith/bestax
Length of output: 236
🏁 Script executed:
Repository: allxsmith/bestax
Length of output: 13573
Bash(sed:*)andBash(find:*)should stay out of the read-only allowlist.sed -ican edit files andfind -execcan launch subprocesses, so these entries widen the agent’s capabilities on untrusted issue text. Drop them here, and in.github/workflows/claude-pr-loop.ymltoo if you want both agents constrained the same way.🤖 Prompt for AI Agents