docs: document project configuration trust model for PR workflows#1336
docs: document project configuration trust model for PR workflows#1336juniperbevensee wants to merge 1 commit into
Conversation
The action already restores project-level configuration (.claude/, .mcp.json, etc.) from the PR base branch via restoreConfigFromBase(), but this behavior isn't covered in the user-facing security docs. This adds a section explaining what the action does automatically and how users of claude-code-base-action or direct claude -p invocations can handle project configuration when processing untrusted PR code.
|
Major company fixing this: alibaba/TorchEasyRec#515 |
|
This is a useful security-doc addition. One small thing I would consider adding: make the restoration step produce an explicit review/audit artifact, not just perform the replacement silently. For PR workflows the most useful artifact would be tiny, for example:
That gives reviewers and follow-up workflows something deterministic to inspect without executing PR-controlled config. It also helps users of I would especially call this out near the |
Summary
claude-code-actionrestores project-level configuration (.claude/,.mcp.json, etc.) from the PR base branch before Claude runs, and what that protects againstclaude-code-base-actionor directclaude -pinvocations who need to handle project configuration themselves when processing PR codepull_request_targetsection with a complementary section covering hooks and project config more broadlyContext
The action already implements
restoreConfigFromBase()insrc/github/operations/restore-config.ts, which replaces PR-controlled configuration paths with base-branch versions. The source comments describe the threat model clearly, but this behavior isn't covered in the user-facing security docs. Users ofclaude-code-base-actionor rawclaude -phave no equivalent guidance.This addition makes the existing protection visible and gives actionable patterns for workflows that don't use the full action.
Changes
One new section in
docs/security.md("Project-Level Configuration in PR Workflows") with three subsections:claude-code-actionhandles it (base-branch restoration,.claude-pr/preservation)claude-code-base-action/claude -pusers (base-only checkout, manual restoration, or switching to the full action)