Skip to content

docs: document project configuration trust model for PR workflows#1336

Open
juniperbevensee wants to merge 1 commit into
anthropics:mainfrom
juniperbevensee:docs/project-config-trust-model
Open

docs: document project configuration trust model for PR workflows#1336
juniperbevensee wants to merge 1 commit into
anthropics:mainfrom
juniperbevensee:docs/project-config-trust-model

Conversation

@juniperbevensee
Copy link
Copy Markdown

Summary

  • Documents that claude-code-action restores project-level configuration (.claude/, .mcp.json, etc.) from the PR base branch before Claude runs, and what that protects against
  • Adds guidance for users of claude-code-base-action or direct claude -p invocations who need to handle project configuration themselves when processing PR code
  • Extends the existing pull_request_target section with a complementary section covering hooks and project config more broadly

Context

The action already implements restoreConfigFromBase() in src/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 of claude-code-base-action or raw claude -p have 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:

  1. What project-level config is and why it matters in PR workflows
  2. How claude-code-action handles it (base-branch restoration, .claude-pr/ preservation)
  3. Options for claude-code-base-action / claude -p users (base-only checkout, manual restoration, or switching to the full action)

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.
@juniperbevensee
Copy link
Copy Markdown
Author

Major company fixing this: alibaba/TorchEasyRec#515

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