Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

chore(ci): add least-privilege tokens, fork-pr guards, audit gate (#3748)

Alberto Schiabeld3875f99d124
diff --git a/.github/workflows/claude-code-doc-review.yml b/.github/workflows/claude-code-doc-review.yml
index 679565e43..b2612ba82 100644
--- a/.github/workflows/claude-code-doc-review.yml
+++ b/.github/workflows/claude-code-doc-review.yml
@@ -9,6 +9,10 @@ on:
- "docs/components/**/*.tsx"
- "docs/app/**/*.tsx"
- "docs/app/**/*.css"
+
+permissions:
+ contents: read
+
jobs:
claude-review:
# Optional: Filter by PR author
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index def4acdb6..dd010c1d4 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -10,6 +10,9 @@ on:
pull_request_review:
types: [submitted]
+permissions:
+ contents: read
+
jobs:
claude:
if: |
diff --git a/.github/workflows/cli.test-installation.yml b/.github/workflows/cli.test-installation.yml
index 2a48ed955..7ef1d5e4b 100644
--- a/.github/workflows/cli.test-installation.yml
+++ b/.github/workflows/cli.test-installation.yml
@@ -19,6 +19,9 @@ on:
default: 'latest'
type: string
+permissions:
+ contents: read
+
jobs:
toolchain-versions:
name: Read toolchain test matrix
diff --git a/.github/workflows/docs-check-links.yml b/.github/workflows/docs-check-links.yml
index e75f88eab..c1d506a94 100644
--- a/.github/workflows/docs-check-links.yml
+++ b/.github/workflows/docs-check-links.yml
@@ -13,6 +13,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
check-links:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs-tests.yml b/.github/workflows/docs-tests.yml
index ce4ac2bec..1602145aa 100644
--- a/.github/workflows/docs-tests.yml
+++ b/.github/workflows/docs-tests.yml
@@ -13,6 +13,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
test:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs-typescript-check.yml b/.github/workflows/docs-typescript-check.yml
index cbecf51ea..7d54cd90a 100644
--- a/.github/workflows/docs-typescript-check.yml
+++ b/.github/workflows/docs-typescript-check.yml
@@ -13,6 +13,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
typescript-check:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs-update-data.yml b/.github/workflows/docs-update-data.yml
index eaf1c2e82..2139014b4 100644
--- a/.github/workflows/docs-update-data.yml
+++ b/.github/workflows/docs-update-data.yml
@@ -7,6 +7,9 @@ on:
types: [apollo-production-deploy]
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
update-data:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs.changelog-notification.yml b/.github/workflows/docs.changelog-notification.yml
index 9e48f63b4..073c3a180 100644
--- a/.github/workflows/docs.changelog-notification.yml
+++ b/.github/workflows/docs.changelog-notification.yml
@@ -6,6 +6,9 @@ on:
paths:
- 'docs/content/changelog/**.mdx'
+permissions:
+ contents: read
+
jobs:
notify-changelog:
name: Send Changelog Notification
diff --git a/.github/workflows/docs.changelog-to-docs.yml b/.github/workflows/docs.changelog-to-docs.yml
index a2ac3a7d3..925d742dd 100644
--- a/.github/workflows/docs.changelog-to-docs.yml
+++ b/.github/workflows/docs.changelog-to-docs.yml
@@ -6,6 +6,9 @@ on:
paths:
- 'docs/content/changelog/**.mdx'
+permissions:
+ contents: read
+
jobs:
suggest-docs-updates:
name: Suggest Documentation Updates
diff --git a/.github/workflows/docs.health-check.yml b/.github/workflows/docs.health-check.yml
index b45746fc6..9b7f863cd 100644
--- a/.github/workflows/docs.health-check.yml
+++ b/.github/workflows/docs.health-check.yml
@@ -5,6 +5,9 @@ on:
- cron: '0 * * * *' # Every hour
workflow_dispatch: # Manual trigger
+permissions:
+ contents: read
+
jobs:
health-check:
name: Check docs accessibility
diff --git a/.github/workflows/docs.sdk-change-sync.yml b/.github/workflows/docs.sdk-change-sync.yml
index ff2bd07e2..669c74b54 100644
--- a/.github/workflows/docs.sdk-change-sync.yml
+++ b/.github/workflows/docs.sdk-change-sync.yml
@@ -10,6 +10,9 @@ on:
- 'python/composio/**'
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
sync-docs:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs.sync-connect-clients.yml b/.github/workflows/docs.sync-connect-clients.yml
index b3a72095d..e7ef876b2 100644
--- a/.github/workflows/docs.sync-connect-clients.yml
+++ b/.github/workflows/docs.sync-connect-clients.yml
@@ -5,6 +5,9 @@ on:
types: [dashboard-production-deploy]
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
sync-clients:
runs-on: ubuntu-latest
diff --git a/.github/workflows/generate-sdk-docs.yml b/.github/workflows/generate-sdk-docs.yml
index 3feca8255..89faabe6f 100644
--- a/.github/workflows/generate-sdk-docs.yml
+++ b/.github/workflows/generate-sdk-docs.yml
@@ -15,6 +15,9 @@ on:
- 'mise.lock'
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
generate-ts-docs:
runs-on: ubuntu-latest
diff --git a/.github/workflows/py.check.yaml b/.github/workflows/py.check.yaml
index 4b7bbaa22..fdf754d1c 100644
--- a/.github/workflows/py.check.yaml
+++ b/.github/workflows/py.check.yaml
@@ -22,6 +22,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
common-checks:
runs-on: ubuntu-latest
diff --git a/.github/workflows/py.release.yml b/.github/workflows/py.release.yml
index 863183d31..c8f147a0f 100644
--- a/.github/workflows/py.release.yml
+++ b/.github/workflows/py.release.yml
@@ -11,6 +11,9 @@ on:
type: boolean
default: false
+permissions:
+ contents: read
+
jobs:
publish-core:
name: Build and release SDK
diff --git a/.github/workflows/py.test.yml b/.github/workflows/py.test.yml
index 43d648a3f..7b125bc6f 100644
--- a/.github/workflows/py.test.yml
+++ b/.github/workflows/py.test.yml
@@ -28,6 +28,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
toolchain-versions:
name: Read toolchain test matrix
diff --git a/.github/workflows/security.secrets-detection.yml b/.github/workflows/security.secrets-detection.yml
index 9da6d83bd..4cd99c5ac 100644
--- a/.github/workflows/security.secrets-detection.yml
+++ b/.github/workflows/security.secrets-detection.yml
@@ -7,9 +7,19 @@ on:
- master
- next
+permissions:
+ contents: read
+
jobs:
secrets:
- uses: ComposioHQ/.github/.github/workflows/secrets-detection.yml@7dc23a1c1c850570499a4a87f272712463fa8dcb # master
+ # The called reusable workflow declares these scopes; a narrower caller
+ # grant clamps its token and the secret-scanning check 403s into a warning.
+ permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+ security-events: write
+ uses: ComposioHQ/.github/.github/workflows/secrets-detection.yml@a6c053d4cb1820a7a85bc7837efe47cc0a559e26 # master (#12: SHA-pinned actions)
secrets: inherit
with:
slack_channel: "buzz-security"
diff --git a/.github/workflows/ts.audit.yml b/.github/workflows/ts.audit.yml
index dd5814bb7..a401c1037 100644
--- a/.github/workflows/ts.audit.yml
+++ b/.github/workflows/ts.audit.yml
@@ -9,6 +9,9 @@ on:
- '.github/workflows/ts.audit.yml'
- 'mise.toml'
- 'mise.lock'
+ - 'package.json'
+ - 'pnpm-lock.yaml'
+ - 'pnpm-workspace.yaml'
pull_request:
branches: [master, next]
paths:
@@ -17,16 +20,23 @@ on:
- '.github/workflows/ts.audit.yml'
- 'mise.toml'
- 'mise.lock'
+ - 'package.json'
+ - 'pnpm-lock.yaml'
+ - 'pnpm-workspace.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
audit:
name: Audit
runs-on: ubuntu-latest
permissions:
+ contents: read
pull-requests: write
steps:
@@ -77,3 +87,6 @@ jobs:
with:
file-path: audit-comment.txt
comment-tag: pnpm-audit-security-warning
+
+ - name: Fail on high/critical advisories
+ run: pnpm audit --prod --audit-level=high
diff --git a/.github/workflows/ts.build.yml b/.github/workflows/ts.build.yml
index 4c62188a5..65739c96a 100644
--- a/.github/workflows/ts.build.yml
+++ b/.github/workflows/ts.build.yml
@@ -31,6 +31,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
# Print Turborepo telemetry events to the logs instead of sending them.
env:
TURBO_TELEMETRY_DEBUG: 1
diff --git a/.github/workflows/ts.release.yml b/.github/workflows/ts.release.yml
index fe03a58cb..695e79c27 100644
--- a/.github/workflows/ts.release.yml
+++ b/.github/workflows/ts.release.yml
@@ -5,6 +5,9 @@ on:
push:
branches: [next]
+permissions:
+ contents: read
+
# Print Turborepo telemetry events to the logs instead of sending them.
env:
TURBO_TELEMETRY_DEBUG: 1
diff --git a/.github/workflows/ts.test-e2e.yml b/.github/workflows/ts.test-e2e.yml
index c0ebaffdc..df6189670 100644
--- a/.github/workflows/ts.test-e2e.yml
+++ b/.github/workflows/ts.test-e2e.yml
@@ -24,6 +24,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
# Print Turborepo telemetry events to the logs instead of sending them.
env:
TURBO_TELEMETRY_DEBUG: 1
@@ -93,6 +96,8 @@ jobs:
- name: Check API keys
id: api-keys
+ env:
+ IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
run: |
missing=()
for name in COMPOSIO_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY; do
@@ -103,8 +108,8 @@ jobs:
if [ "${#missing[@]}" -gt 0 ]; then
echo "available=false" >> "$GITHUB_OUTPUT"
- if [ "$GITHUB_ACTOR" = "dependabot[bot]" ]; then
- echo "::notice::Skipping secret-backed Node.js E2E tests for Dependabot; missing ${missing[*]}."
+ if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
+ echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
exit 0
fi
@@ -179,7 +184,34 @@ jobs:
- name: Build
run: pnpm run build:packages
+ - name: Check API keys
+ id: api-keys
+ env:
+ IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
+ run: |
+ missing=()
+ for name in COMPOSIO_API_KEY OPENAI_API_KEY; do
+ if [ -z "${!name}" ]; then
+ missing+=("$name")
+ fi
+ done
+
+ if [ "${#missing[@]}" -gt 0 ]; then
+ echo "available=false" >> "$GITHUB_OUTPUT"
+ if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
+ echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
+ exit 0
+ fi
+
+ printf '::error::%s is not set\n' "${missing[@]}"
+ exit 1
+ fi
+
+ echo "available=true" >> "$GITHUB_OUTPUT"
+ echo "✅ API keys are configured"
+
- name: Run Deno E2E Tests
+ if: steps.api-keys.outputs.available == 'true'
run: pnpm run test:e2e:deno
# CLI E2E tests, running in scratch Docker to isolate environment
@@ -218,6 +250,32 @@ jobs:
- name: Build
run: pnpm run build:packages
+ - name: Check API keys
+ id: api-keys
+ env:
+ IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
+ run: |
+ missing=()
+ for name in COMPOSIO_API_KEY OPENAI_API_KEY COMPOSIO_USER_API_KEY; do
+ if [ -z "${!name}" ]; then
+ missing+=("$name")
+ fi
+ done
+
+ if [ "${#missing[@]}" -gt 0 ]; then
+ echo "available=false" >> "$GITHUB_OUTPUT"
+ if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
+ echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
+ exit 0
+ fi
+
+ printf '::error::%s is not set\n' "${missing[@]}"
+ exit 1
+ fi
+
+ echo "available=true" >> "$GITHUB_OUTPUT"
+ echo "✅ API keys are configured"
+
- name: Pre-build Docker image for CLI e2e tests
run: |
CLI_VERSION=$(node -p "require('./ts/packages/cli/package.json').version")
@@ -232,6 +290,7 @@ jobs:
.
- name: Run CLI E2E Tests
+ if: steps.api-keys.outputs.available == 'true'
run: pnpm run test:e2e:cli
# Cloudflare Workerd E2E tests
@@ -271,6 +330,8 @@ jobs:
- name: Check API keys
id: api-keys
+ env:
+ IS_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
run: |
missing=()
for name in COMPOSIO_API_KEY OPENAI_API_KEY; do
@@ -281,8 +342,8 @@ jobs:
if [ "${#missing[@]}" -gt 0 ]; then
echo "available=false" >> "$GITHUB_OUTPUT"
- if [ "$GITHUB_ACTOR" = "dependabot[bot]" ]; then
- echo "::notice::Skipping secret-backed Cloudflare E2E tests for Dependabot; missing ${missing[*]}."
+ if [ "$GITHUB_ACTOR" = "dependabot[bot]" ] || [ "$IS_FORK_PR" = "true" ]; then
+ echo "::notice::Skipping secret-backed E2E tests; missing ${missing[*]}."
exit 0
fi
diff --git a/.github/workflows/ts.test.yml b/.github/workflows/ts.test.yml
index 981a09594..3e89d3823 100644
--- a/.github/workflows/ts.test.yml
+++ b/.github/workflows/ts.test.yml
@@ -24,12 +24,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
test:
name: Test Typescript SDK
runs-on: ubuntu-latest
- permissions:
- pull-requests: write
steps:
- name: Checkout Code
diff --git a/.github/workflows/ts.typecheck.yml b/.github/workflows/ts.typecheck.yml
index dd32bff8c..cd080ebc4 100644
--- a/.github/workflows/ts.typecheck.yml
+++ b/.github/workflows/ts.typecheck.yml
@@ -24,6 +24,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+permissions:
+ contents: read
+
jobs:
typecheck:
name: Typecheck Typescript SDK