Thesis
Glyph’s core promise depends on policy correctness. If hidden source leaks through projections, metadata, exports, logs, or agent context, Glyph fails. The policy language must be simple enough to audit, expressive enough to model real projects, and conservative enough to fail closed.Problem
Git has no native visibility policy. Teams compensate with private repos, forks, secret managers,.gitignore, social rules, and CI discipline.
Glyph moves visibility into source control itself. That creates power and risk:
- A policy bug can leak private source.
- A generated artifact can expose hidden implementation.
- Git export can contain unreachable private objects.
- Agents can accidentally receive forbidden context.
- Logs, diffs, and review comments can reveal secrets even when files do not.
Goals
- Define what policy controls.
- Define expected leak surfaces.
- Provide a minimal policy language shape.
- Require fail-closed behavior.
- Make publication checks explicit and auditable.
- Support secrets, private packages, embargoed fixes, and agent scopes.
Non-Goals
- Proving formal security properties in the first version.
- Replacing runtime secret managers.
- Designing organization-wide IAM.
- Supporting arbitrary policy code execution.
- Solving all supply-chain security problems.
Policy Scope
Policy applies to:- Glyph read access
- Work context creation
- File reads and writes
- Directory listings
- Search results
- Diffs
- Generated artifacts
- Test logs
- Agent context bundles
- Publication requests
- Git exports
- GitHub remote sync
- Import adoption
Policy Language Shape
The first policy language should be declarative. It should express:- Realms
- Groups and identities
- Read grants
- Write grants
- Publication grants
- Required reviewers
- Path rules
- Label rules
- Redaction rules
- Export rules
- Import rules
Threat Model
Protected Assets
- Private source files
- Secrets and credentials
- Embargoed vulnerability details
- Private package implementation
- Customer-specific code
- Agent prompts and transcripts
- Review comments
- Build logs
- Import/export metadata
Actors
- Public anonymous user
- Maintainer
- Security maintainer
- CI system
- Coding agent
- External contributor
- Compromised dependency or tool
- Misconfigured remote origin
Threats
- Public projection includes private file contents.
- Public projection includes private file paths.
- Git export contains unreachable private blobs.
- Generated types or bundles reveal private implementation.
- Agent receives more context than intended.
- Agent writes private content into public files.
- CI logs expose hidden content.
- Commit messages or PR descriptions mention embargoed information.
- GitHub import adopts untrusted changes without policy checks.
- Policy change accidentally widens access.
Required Invariants
- Fail closed If policy cannot decide, access is denied.
- Policy before projection Filtering happens before materialization, search, diffing, or export.
- Metadata is source Paths, names, messages, logs, and transcripts are policy-controlled.
- Publication requires checks Visibility widening is never implicit.
- Agents receive least privilege Agent projections are scoped and auditable.
- Exports are clean Git and GitHub exports are generated from authorized projections only.
- Policy changes are reviewed Any policy update that widens access requires review.
Publication Check Requirements
Before publishing, Glyph should check:- Actor permission
- Source and destination realms
- Object labels
- Path rules
- Generated artifact provenance
- Secret scanning results
- Required reviewers
- Remote origin mode
- Metadata leak risks
- Audit record creation
Prototype Defaults
- Policy is YAML.
- Deny by default.
- Realm inheritance is allowed only when effective policy can be rendered.
- Most restrictive rule wins when paths and labels conflict.
.env*is denied frompublic.secret-never-publishis denied everywhere except local private storage.- Publication to
publicrequires at least one explicit action. - Git export always uses a freshly generated repository.
- Agent context bundles are treated as projections and audited.
- Policy changes that widen access require human approval.
- No custom policy code execution in v1.
- Built-in baseline secret scanning is enabled by default.
- External scanners may be configured as additional checks.
Success Criteria
This spec is successful if a prototype can:- Load a declarative policy.
- Deny public access to private paths and labels.
- Block publication of
.envfiles. - Require review for security-to-public publication.
- Scope an agent context bundle by policy.
- Produce a clean Git export with no hidden objects.
- Record policy decisions in audit logs.