-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Propose a unified policy format that works seamlessly for both:
- witness-wrapper (CI pipelines)
- witness-signer-mcp (AI agent attestations)
Problem Statement
Currently, organizations need to maintain separate policy configurations for:
- CI/CD pipelines using witness-wrapper
- AI agent workflows using witness-signer-mcp
This leads to:
- Policy drift between environments
- Duplicate maintenance effort
- Inconsistent security postures
Proposed Architecture
┌─────────────────────────────────────────────────────────┐
│ Unified Policy Format │
│ │
│ steps: │
│ - name: test │
│ type: validation │
│ commands: │
│ - pattern: "go test" │
│ - pattern: "npm test" │
│ attestors: │
│ - command-run │
│ - git │
│ required_for: [ci, ai] │
│ │
│ - name: lint │
│ type: validation │
│ commands: │
│ - pattern: "golangci-lint" │
│ - pattern: "npm run lint" │
│ required_for: [ci, ai] │
│ │
│ - name: coverage │
│ type: quality-gate │
│ threshold: 80 │
│ required_for: [ci] │
│ optional_for: [ai] │
└─────────────────────────────────────────────────────────┘
│ │
▼ ▼
┌─────────────────────┐ ┌─────────────────────────────┐
│ witness-wrapper │ │ witness-signer-mcp │
│ (CI Pipeline) │ │ (AI Agent) │
│ │ │ │
│ - Runs in GHA/GL │ │ - Runs in Claude Code │
│ - Full attestation │ │ - Interactive attestation │
│ - SLSA compliance │ │ - Human-in-loop signing │
└─────────────────────┘ └─────────────────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────────────────────┐
│ Shared Verification Layer │
│ │
│ witness verify --policy unified-policy.json │
│ │
│ - Same policy works for both CI and AI attestations │
│ - Consistent security requirements │
│ - Single source of truth │
└─────────────────────────────────────────────────────────┘
Key Features
1. Semantic Step Types
Instead of exact command matching, use semantic types:
validation- linting, testing, type checkingquality-gate- coverage thresholds, complexity limitssecurity-scan- vulnerability scanning, secret detectionbuild- compilation, bundling
2. Environment-Specific Requirements
required_for: [ci] # Only required in CI
required_for: [ai] # Only required for AI agents
required_for: [ci, ai] # Required in both
optional_for: [ai] # Optional for AI, provides bonus trust3. Command Pattern Matching
Use glob/regex patterns instead of exact strings:
commands:
- pattern: "go test ./..."
- pattern: "npm test"
- pattern: "*jest*"4. Shared Attestor Configuration
Common attestor settings that work in both contexts:
attestors:
git:
require_clean: true
allowed_statuses: [untracked]
command-run:
capture_output: trueBenefits
- Single Policy Definition - One policy file governs both CI and AI
- Consistent Security - Same requirements enforced everywhere
- Flexible Enforcement - Different requirements per environment
- Easier Auditing - One place to review security requirements
- Reduced Drift - No policy synchronization needed
Implementation Phases
Phase 1: Policy Schema
- Define unified YAML/JSON schema
- Support for both exact and pattern matching
- Environment-specific requirements
Phase 2: witness-wrapper Integration
- Update witness-wrapper to read unified format
- Generate witness policies from unified schema
- Backwards compatibility with existing policies
Phase 3: witness-signer-mcp Integration
- Update witness-signer-mcp to read unified format
- Generate Rego policies from unified schema
- Support for interactive policy creation
Phase 4: Tooling
- Policy linter for unified format
- Migration tool from existing policies
- Documentation and examples
Questions for Discussion
- Should we support YAML, JSON, or both?
- How do we handle attestor-specific configuration differences?
- What's the migration path for existing policies?
- Should we support policy inheritance/composition?
Related Issues
- Feature: Relaxed command matching with patterns/globs #2 Relaxed Command Matching
- Feature: Semantic step-type policies #3 Semantic Step-Type Policies
- Feature: Pre-defined step templates for common project types #6 Pre-defined Step Templates
- Feature: Policy inheritance for organizational standards #7 Policy Inheritance/Composition
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels