Skip to content

docs: update CLI naming to capiscio (consolidation)#24

Merged
beonde merged 6 commits intomainfrom
fix/rfc002-alignment
Feb 3, 2026
Merged

docs: update CLI naming to capiscio (consolidation)#24
beonde merged 6 commits intomainfrom
fix/rfc002-alignment

Conversation

@beonde
Copy link
Member

@beonde beonde commented Feb 3, 2026

Updates CLI naming references and adds RFC-002 compliance improvements.

Changes

CLI Naming Consolidation

  • Updated CLI reference URL from capiscio-cli to capiscio in docs

RFC-002 Compliance (from previous commits)

  • Added TrustLevel.LEVEL_0 (Self-Signed) and LEVEL_4 (Extended Validated)
  • Implemented IAL (Identity Assurance Level) support with cnf claim handling
  • Added exclude_paths parameter to FastAPI middleware
  • Enhanced BadgeClaims with has_key_binding and confirmation_key properties

Bug Fixes (from Copilot Review)

  • Fixed to_dict() to preserve cnf claim for IAL-1 round-trip serialization
  • Fixed has_key_binding to consistently check both ial=='1' AND cnf presence
  • Documented that LEVEL_0 not available via CA request

Cleanup

  • Removed unused pytest markers (integration, slow) from config

- Add LEVEL_0 (SS) and LEVEL_4 (EV) to TrustLevel enum per RFC-002 §5
- Update TrustLevel comments to use RFC-002 canonical names
- Add 'ial' field to BadgeClaims for Identity Assurance Level
- Add 'raw_claims' for advanced access to full JWT payload
- Add 'has_key_binding' property for IAL-1 detection
- Add 'confirmation_key' property for cnf claim access
- Fix audience string to list conversion
- Implement 'exclude_paths' parameter in FastAPI middleware
- Add tests for all new features
Copilot AI review requested due to automatic review settings February 3, 2026 21:28
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

✅ All checks passed! Ready for review.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
capiscio_sdk/badge.py 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR claims to consolidate CLI naming from capiscio-cli to capiscio, but actually contains substantial unrelated feature additions. Only one file (docs/guides/scoring.md) contains the stated CLI naming change, while the remaining five files introduce new badge features including IAL support, additional trust levels (LEVEL_0 and LEVEL_4), key binding properties, and FastAPI middleware enhancements.

Changes:

  • Updated one CLI documentation link from capiscio-cli to capiscio format
  • Added TrustLevel.LEVEL_0 (Self-Signed) and LEVEL_4 (Extended Validated) to badge system
  • Implemented IAL (Identity Assurance Level) support with cnf (confirmation) claim handling
  • Added exclude_paths parameter to FastAPI middleware for bypassing verification on specific routes
  • Enhanced BadgeClaims with has_key_binding and confirmation_key properties for IAL-1 badges
  • Removed unused pytest markers (integration, slow) from configuration

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/guides/scoring.md Updated CLI reference URL - the only change matching PR description
capiscio_sdk/badge.py Added LEVEL_0/LEVEL_4 trust levels, IAL support, key binding properties, and expanded documentation
capiscio_sdk/integrations/fastapi.py Added exclude_paths parameter to allow skipping verification for health checks and public endpoints
tests/unit/test_badge.py Added comprehensive tests for new trust levels, IAL claims, and key binding functionality
tests/unit/test_fastapi_integration.py Added test for exclude_paths middleware feature
pyproject.toml Removed unused pytest markers configuration

"agent_name": self.agent_name,
"aud": self.audience,
"ial": self.ial,
}
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The to_dict method doesn't preserve the cnf (confirmation) claim from raw_claims for IAL-1 badges. When a BadgeClaims object with cnf is serialized and then deserialized, the cnf claim will be lost. This could break round-trip serialization for IAL-1 badges.

Consider either:

  1. Adding cnf to the output if present in raw_claims
  2. Returning raw_claims directly (if to_dict is meant to serialize back to JWT format)
  3. Documenting that to_dict produces a minimal representation and raw_claims should be used for full JWT claims
Suggested change
}
}
# Preserve cnf claim for IAL-1 / key-bound badges if it was present
if self.raw_claims is not None and "cnf" in self.raw_claims:
result["cnf"] = self.raw_claims["cnf"]

Copilot uses AI. Check for mistakes.
subject=data.get("sub", ""),
issued_at=_from_utc_timestamp(data.get("iat", 0)),
expires_at=_from_utc_timestamp(data.get("exp", 0)),
trust_level=TrustLevel.from_string(data.get("trust_level", "1")),
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

With the addition of TrustLevel.LEVEL_0 (Self-Signed), the default trust level in from_dict defaults to "1" (Registered) when the claim is missing. This seems intentional to avoid accepting self-signed badges by default, which is good for security.

However, this creates an inconsistency: if a JWT has no trust_level claim, from_dict will create a BadgeClaims with LEVEL_1, but when serialized back with to_dict, it will have trust_level="1" even though the original JWT didn't have this field. This could cause signature verification failures if the badge is re-signed.

Consider either:

  1. Making trust_level a required field (raise error if missing)
  2. Making trust_level Optional and defaulting to None
  3. Documenting that missing trust_level is normalized to "1" for security reasons

Copilot uses AI. Check for mistakes.
Comment on lines 513 to 517
trust_level: Requested trust level per RFC-002 §5:
- 1 (REG): Registered - Account registration
- 2 (DV): Domain Validated - DNS/HTTP proof
- 3 (OV): Organization Validated - Legal entity
- 4 (EV): Extended Validated - Security audit
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The updated docstring for trust_level omits LEVEL_0 (Self-Signed) which is now available in the TrustLevel enum. According to the badge.py docstrings, LEVEL_0 is "Development only" and has iss == sub (self-signed).

This omission is likely intentional since request_badge is for requesting badges from a CA, and self-signed badges wouldn't be issued by a CA. However, for consistency and clarity, consider either:

  1. Adding a note that LEVEL_0 is not available via CA (self-signed only)
  2. Adding validation that rejects trust_level=0 with a clear error message

Copilot uses AI. Check for mistakes.
Command-line usage with `--detailed-scores` flag and JSON output.

[:octicons-arrow-right-24: CLI Usage](https://docs.capisc.io/capiscio-cli/scoring-system/)
[:octicons-arrow-right-24: CLI Usage](https://docs.capisc.io/reference/cli/#validate)
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This is the only change in the entire PR that actually relates to the stated purpose of "CLI naming consolidation from capiscio-cli to capiscio". All other changes in this PR (5 files) are unrelated feature additions including:

  • Adding TrustLevel LEVEL_0 and LEVEL_4
  • Adding IAL (Identity Assurance Level) support
  • Adding key binding properties (has_key_binding, confirmation_key)
  • Adding exclude_paths parameter to FastAPI middleware
  • Removing pytest markers from pyproject.toml

Either the PR description is incorrect and should describe these feature additions, or these unrelated changes should be moved to separate PRs. Mixing unrelated changes makes code review difficult and complicates the git history.

Copilot uses AI. Check for mistakes.
Comment on lines 198 to 205
"""Check if this badge has IAL-1 key binding (cnf claim).

Per RFC-002 §7.2.1, IAL-1 badges include a 'cnf' (confirmation) claim
that cryptographically binds the badge to the agent's private key.
"""
if self.raw_claims is None:
return self.ial == "1"
return "cnf" in self.raw_claims
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The logic in has_key_binding is inconsistent. When raw_claims is None, it returns True if ial == "1", but when raw_claims exists, it only checks for the presence of "cnf". This means a badge could have ial="1" but no cnf claim in raw_claims, and has_key_binding would return True when raw_claims is None but False when raw_claims exists.

The logic should be consistent: either always check both ial == "1" AND presence of cnf, or trust the ial value alone. Based on RFC-002 §7.2.1, IAL-1 badges MUST have a cnf claim, so the check should verify both conditions together.

Suggested change
"""Check if this badge has IAL-1 key binding (cnf claim).
Per RFC-002 §7.2.1, IAL-1 badges include a 'cnf' (confirmation) claim
that cryptographically binds the badge to the agent's private key.
"""
if self.raw_claims is None:
return self.ial == "1"
return "cnf" in self.raw_claims
"""Check if this badge has IAL-1 key binding (ial='1' and cnf claim).
Per RFC-002 §7.2.1, IAL-1 badges MUST include a 'cnf' (confirmation) claim
that cryptographically binds the badge to the agent's private key.
"""
return (
self.ial == "1"
and self.raw_claims is not None
and "cnf" in self.raw_claims
)

Copilot uses AI. Check for mistakes.
- Fix to_dict() to preserve cnf claim for IAL-1 round-trip serialization
- Fix has_key_binding to consistently check both ial=='1' AND cnf presence
- Document that LEVEL_0 not available via CA request
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

✅ All checks passed! Ready for review.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

✅ Integration tests passed! Server validation, BadgeKeeper, and gRPC tests all working.

@beonde beonde merged commit 332a893 into main Feb 3, 2026
13 of 16 checks passed
@beonde beonde deleted the fix/rfc002-alignment branch February 3, 2026 22:08
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