Skip to content

docs: Per-session GitHub authentication setup guide #257

Closed as not planned
Closed as not planned

Description

@neist

Overview

Document how to set up per-session GitHub authentication for group chats with repository-specific access control.

Use Cases

  • Family group: Access to only username/family-recipes repository
  • Business group: Access to organization repositories (e.g., company/*)
  • Personal projects: Full access to personal repositories

Prerequisites

  • GitHub CLI installed in sandbox (see related issue)
  • GH_CONFIG_DIR configured to persist in workspace

Authentication Setup Workflow

Option 1: Fine-Grained Personal Access Tokens (Recommended)

Step 1: Create tokens with specific permissions

  1. Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
  2. Create separate tokens for each use case:

Family Token:

  • Token name: clawdbot-family-group
  • Repository access: Only select repositories → username/family-recipes
  • Permissions:
    • Contents: Read and write
    • Issues: Read and write
    • Pull requests: Read and write

Business Token:

  • Token name: clawdbot-business-group
  • Repository access: All repositories (or select organization)
  • Permissions: (customize as needed)

Step 2: Authenticate each group session

Send a message in the family group:

Hey, can you run: gh auth login --with-token

Agent responds with instructions, you paste the family token.

Repeat for business group with business token.

Option 2: GitHub Apps (Advanced)

Create separate GitHub Apps with repository-specific installations:

  • More granular control
  • Better audit logging
  • Requires GitHub App setup and installation

Verification Commands

Check current auth:

gh auth status

List accessible repos:

gh repo list

Test repository access:

gh repo view username/family-recipes
gh issue list --repo username/family-recipes

Security Considerations

  1. Token Storage:

    • Tokens stored in ~/.clawdbot/sandbox/<session>/.config/gh/hosts.yml
    • Standard filesystem permissions (root-owned)
    • Not exposed to other sessions
  2. Token Rotation:

    • Tokens should be rotated periodically
    • Set expiration dates on fine-grained tokens
    • Revoke and recreate if compromised
  3. Audit Logging:

    • GitHub tracks all API usage by token
    • Review security logs regularly

Documentation Sections to Add

Create new doc file: docs/github-integration.md

Sections:

  • Overview of per-session GitHub access
  • Setting up fine-grained tokens
  • Authentication workflow
  • Repository access verification
  • Token management and rotation
  • Troubleshooting common issues
  • Security best practices

Testing Checklist

  • Document token creation process with screenshots
  • Test authentication in family group session
  • Test authentication in business group session
  • Verify repository access isolation
  • Document token revocation process
  • Add troubleshooting section

Files to Create/Modify

  • docs/github-integration.md (new)
  • docs/groups.md (add GitHub integration section)
  • docs/security.md (add token storage security notes)
  • README.md (add link to GitHub integration docs)

Related Issues

  • Requires GitHub CLI in sandbox to be implemented first

Activity

  1. added a commit that references this issue on Feb 22, 2026
  2. locked as resolved and limited conversation to collaborators on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions