Skip to content

Harden Zyra Shield trusted authorization - #41

Merged
sonoxo merged 2 commits into
mainfrom
fix/zyra-shield-trusted-authorization
Aug 26, 2026
Merged

Harden Zyra Shield trusted authorization#41
sonoxo merged 2 commits into
mainfrom
fix/zyra-shield-trusted-authorization

Conversation

@sonoxo

@sonoxo sonoxo commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • resolve agent scopes from an organization-scoped server-side grant registry
  • deny unregistered agents by default
  • derive restricted-data egress approval from authenticated owner/admin confirmation
  • bind scan evidence hashes to the exact manifest digest

Configuration

Set ZYRA_SHIELD_AGENT_GRANTS to a JSON array of trusted grants:

[{"organizationId":"org-id","agentId":"agent-id","scopes":["repository:read"]}]

Security

Client-provided scope declarations and egress assertions are no longer trusted. Missing or invalid grant configuration fails closed.

Addresses the three review findings raised on merged PR #38.

@sonoxo
sonoxo merged commit ea53d49 into main Aug 26, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 451ece04b8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/zyra-shield.ts
Comment on lines 89 to +92
const evaluatedRequest = {
...request,
declaredScopes: declaredScopes ?? [],
agentRegistered: declaredScopes !== undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require granted scopes for scoped capabilities

When a registered agent submits requestedScopes: [], which the schema permits, the set-difference check finds no undeclared scopes and a low-risk capability such as repository_read returns allow even when the registry grant has no repository scope. Because the caller still controls which scopes it claims to need and those scopes are not tied to the selected capability, it can bypass the new server-side grants simply by omitting them; derive the required scopes from the capability/action or otherwise require the relevant granted scope.

Useful? React with 👍 / 👎.

Comment on lines +163 to +165
if (request.agentRegistered === false) {
reasons.push("Agent is not registered in the organization-scoped trusted registry.");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deny requests with unspecified registration state

For direct users of the exported evaluateShieldRequest API, omitting agentRegistered still passes this check because only the explicit value false is denied. Existing callers compiled against the optional field therefore continue to receive allow for otherwise valid requests without proving registration, contrary to the stated deny-by-default behavior; require agentRegistered === true instead.

Useful? React with 👍 / 👎.

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