Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs: Add comprehensive security documentation for PAT_TOKEN usage

LearningCircuitfc28bdb2cdd4
diff --git a/.github/workflows/sync-main-to-dev.yml b/.github/workflows/sync-main-to-dev.yml
index 4b7e99b2af..fe2b8e7197 100644
--- a/.github/workflows/sync-main-to-dev.yml
+++ b/.github/workflows/sync-main-to-dev.yml
@@ -22,7 +22,24 @@ jobs:
uses: actions/checkout@v5
with:
fetch-depth: 0
- # Use PAT_TOKEN to allow pushing changes to workflow files
+ # SECURITY: Dual-token strategy for workflow file modifications
+ # - PAT_TOKEN (used here): Allows git push of workflow file changes.
+ # GITHUB_TOKEN cannot modify .github/workflows/* by design (security feature).
+ # - GITHUB_TOKEN (used for PR creation): Ensures PR is created by github-actions[bot]
+ # for proper approval workflow.
+ #
+ # PAT_TOKEN Requirements:
+ # - Type: Fine-grained Personal Access Token (preferred over classic)
+ # - Scope: 'workflows' permission only (minimal required)
+ # - Expiration: ≤90 days with documented rotation schedule
+ # - Level: Repository secret (not organization)
+ # - Owner: Repository maintainers (see SECURITY.md for contacts)
+ #
+ # Risk Mitigation:
+ # - Token stored in git config is only accessible within this job
+ # - All workflow steps are controlled (no untrusted code execution)
+ # - Repository branch protections prevent unauthorized workflow changes
+ # - Regular token rotation enforced via expiration
token: ${{ secrets.PAT_TOKEN }}
- name: Configure Git
@@ -108,8 +125,11 @@ jobs:
if: steps.check_sync.outputs.sync_needed == 'true'
uses: actions/github-script@v8
with:
- # Use GITHUB_TOKEN so the PR is created by github-actions[bot]
- # This allows PAT_TOKEN to approve it later
+ # SECURITY: Use GITHUB_TOKEN (not PAT_TOKEN) for PR creation
+ # - Ensures PR is created by github-actions[bot] account
+ # - Allows PAT_TOKEN (different actor) to approve it later
+ # - Prevents self-approval security issue
+ # This complements PAT_TOKEN usage in checkout (see above)
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const branchName = '${{ steps.create_branch.outputs.branch_name }}';
@@ -325,6 +345,10 @@ jobs:
id: auto_approve
uses: actions/github-script@v8
with:
+ # SECURITY: Use PAT_TOKEN for approval (different from PR creator)
+ # - PR was created by GITHUB_TOKEN (github-actions[bot])
+ # - PAT_TOKEN represents a different actor, allowing approval
+ # - Prevents self-approval (GitHub requirement)
github-token: ${{ secrets.PAT_TOKEN }}
script: |
const prNumber = ${{ steps.verify_commits.outputs.pr_number }};
@@ -358,6 +382,9 @@ jobs:
if: steps.auto_approve.outputs.approved == 'true'
uses: actions/github-script@v8
with:
+ # SECURITY: Use PAT_TOKEN for auto-merge enablement
+ # - Requires same permissions as approval
+ # - Must be same actor that approved the PR
github-token: ${{ secrets.PAT_TOKEN }}
script: |
const prNumber = ${{ steps.verify_commits.outputs.pr_number }};