Skip to content

feat(security): add project-scoped AI Agent token grants - #23

Merged
zskbot merged 13 commits into
mainfrom
feat/token-vault-agent-scopes
Nov 7, 2026
Merged

zskbot merged 13 commits into
mainfrom
feat/token-vault-agent-scopes

Conversation

@zskbot

@zskbot zskbot commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to merged PR #22. This adds the machine-identity and project-scope layer on top of the Token Vault security baseline.

Included

  • D1 schema for project-tagged vault records, AI-agent credentials, and per-project grants.
  • Owner-only one-time API-key issuance; only the SHA-256 hash is stored.
  • Agent key expiry (1–365 days, default 90) and owner revocation.
  • Per-project metadata and reveal permissions.
  • Machine endpoints to list metadata and reveal only tokens in explicitly granted projects.
  • Audited agent token reveals and last-used timestamps.
  • Owner-only dashboard controls to issue keys and set project grants.
  • Runtime tests for Origin rejection, bearer authentication, project isolation, reveal permissions, and revocation.

Security boundaries

  • Agent API keys are independent of the human TOKEN password/session.
  • Agent endpoints reject browser Origin headers and do not use cookie authentication.
  • A metadata grant cannot reveal plaintext; only reveal can.
  • No cross-project enumeration is exposed.
  • Staff SSO is handled separately in PR feat(security): add Cloudflare Access staff identity controls #24.

Not included

  • No Cloudflare Worker or D1 resources, secrets, Access policy, DNS, or deployment were created.
  • No real tokens or passwords were added.
  • Keep this PR unmerged until security review and CI pass.

@zskbot
zskbot changed the base branch from fix/token-vault-security-and-dashboard to main November 7, 2026 18:09
@zskbot
zskbot marked this pull request as ready for review November 7, 2026 18:14
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-07T18:14:45.792210Z
We couldn’t complete this review. Comment @codex review to try again.
837af56 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zskbot
zskbot merged commit 5b2fe10 into main Nov 7, 2026
1 check passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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