Skip to content

Aegis: Verifiable Safety Layer for AI Document Edits - #214

Open
Vishwak-8055 wants to merge 3 commits into
superdocsapp:mainfrom
Vishwak-8055:feat/aegis-verifiable-edit-engine
Open

Aegis: Verifiable Safety Layer for AI Document Edits#214
Vishwak-8055 wants to merge 3 commits into
superdocsapp:mainfrom
Vishwak-8055:feat/aegis-verifiable-edit-engine

Conversation

@Vishwak-8055

Copy link
Copy Markdown

Aegis — Verifiable Safety Layer for AI Document Edits

Aegis introduces a verification and decision layer for AI-driven document transformations. Its core objective is simple: an AI-generated edit should not be accepted merely because it looks plausible—it must first be verified against the requested scope and protected document invariants.

The implementation is deliberately conservative: deterministic checks remain authoritative, AI-assisted reasoning is isolated behind an explicit provider boundary, and failed edits are blocked or recovered rather than silently committed.

Engineering highlights

  • Intent → verification contract — compiles an editing instruction into explicit scope and protected invariants.
  • Multi-layer verification pipeline — independently checks scope, structure, formatting, protected values, semantic obligations, and drift.
  • Protected-value preservation — detects unintended changes to numbers, dates, currencies, URLs, identifiers, and other sensitive values.
  • Semantic safety checks — detects changes to obligation/modality meaning such as shall, must, may, prohibitions, permissions, and negation.
  • Risk-based decision engine — converts verification findings into deterministic accept, review, or block outcomes.
  • Bounded recovery — failed transformations can be retried through constrained recovery strategies rather than being blindly committed.
  • Prompt-injection handling — document content is treated as untrusted input and cannot override the verification policy.
  • Tamper-evident evidence — produces an EditProof containing verification results, evidence, policy decisions, and document hashes.
  • Typed document boundary — isolates document execution behind a SuperDocClient interface with a deterministic mock adapter for development and CI.
  • Accessible inspection UI — provides an evidence-oriented interface for reviewing verification results and proof artifacts.

Verification

The implementation was validated end-to-end with:

  • 101/101 automated tests passing
  • 21/21 adversarial benchmark cases passing
  • 14/14 unsafe edits blocked
  • 7/7 safe edits accepted
  • 15/15 UI checks passing
  • 0 accessibility violations across 40 axe rules
  • End-to-end blocked-edit and verified-edit scenarios exercised through the pipeline

Design principle

Aegis treats AI output as untrusted proposed state, not authoritative document state.

The execution boundary therefore follows:

Instruction → Intent Contract → AI/Document Edit → Verification → Risk Decision → Commit or Block → EditProof

This makes verification a first-class part of the document-editing workflow rather than an after-the-fact quality check.

SuperDocs integration

The implementation keeps the verification core independent from the concrete document client. The SuperDocClient abstraction defines the integration boundary, while the mock adapter provides deterministic local execution and CI coverage.

This allows the safety layer to be integrated with the document-editing workflow without coupling the verification logic to a single execution implementation.

Scope of this PR

This PR adds the Aegis use case under:

use-cases/Vishwak-8055/aegis-verifiable-edit-engine/

It is self-contained, documented, tested, and designed as an integration-ready verification layer rather than a standalone UI demonstration.

Submitted by Vishwak Teja.

@Vishwak-8055 Vishwak-8055 changed the title feat: add Aegis, a verifiable safety layer for AI document edits Aegis: Verifiable Safety Layer for AI Document Edits Aug 30, 2026
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