360 Secure SkillHub
360 安全技能中心

GitHub Token

通过用户自建的 GitHub Personal Access Token 运行 scripts/gh.py,完成仓库列表、克隆、建分支、提交推送、创建 PR 与 issue、查看仓库信息等操作;不使用 OAuth,权限由 PAT scope 控制,token 需用户自行保存并避免泄露。

dannyshmueli
dannyshmueli
热度 51.45
最近更新 2026-07-24 06:17:27
分类:开发依赖:代码执行 / 第三方 API / 读写文件应用场景:API 集成 / DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add github-token
Metadata
name
github-pat
description
Interact with GitHub using Personal Access Tokens. Secure, user-controlled access - no OAuth, no full account access. Clone, push, branch, PR, issues. Use when user wants to work with GitHub repos.

GitHub PAT

Interact with GitHub using Personal Access Tokens. User controls access via PAT scopes.

Setup

User provides their PAT:

1. Create PAT at github.com/settings/tokens
2. Select scopes (repo for full, public_repo for public only)
3. Provide token to agent

Store in TOOLS.md or pass via --token.

Commands

# List repos you have access to
python3 scripts/gh.py repos [--token TOKEN]

# Clone a repo
python3 scripts/gh.py clone owner/repo [--token TOKEN]

# Create branch
python3 scripts/gh.py branch <branch-name> [--repo owner/repo]

# Commit and push
python3 scripts/gh.py push "<message>" [--branch branch] [--repo owner/repo]

# Open a pull request
python3 scripts/gh.py pr "<title>" [--body "description"] [--base main] [--head branch]

# Create an issue
python3 scripts/gh.py issue "<title>" [--body "description"] [--repo owner/repo]

# View repo info
python3 scripts/gh.py info owner/repo

Security Model

  • User controls access via PAT scopes
  • No OAuth - no "allow full access" prompts
  • Least privilege - user creates PAT with minimal needed scopes
  • Fine-grained PATs supported for specific repo access

Token Storage

Agent stores token in TOOLS.md under ### GitHub section. Never expose in logs or messages.