SHIELD: SIGNED BACKUP
LYTA Shield protects against:
- Output containing commands that would compromise the host if copied/pasted into a terminal.
- Adversarial prompts instructing the model to emit dangerous commands.
- Browser-side prompt injection or credential exfiltration.
- Local tampering with the LYTA Shield codebase or configuration.
0— SAFE1— SUSPICIOUS (confirm with user)2— DANGEROUS (block, never execute)
Every critical file in the repository is protected by a signed backup chain:
scripts/backup-sign.pycreates a tarball of the repository tree, computes SHA-256, and signs the backup with Ed25519.scripts/verify-backup.pyreconstructs the signed message and verifies it against the external trust anchor. A manifest can never select its own verification key.bin/lyta-shield backupcreates a new signed backup;bin/lyta-shield verify-backupchecks the latest.- Self-heal accepts repository Git-object bytes or a verified backup member only when the bytes match the pinned per-file integrity digest. It never downloads mutable branch content or calls
extractall().
var/keys/backup-sign.nacl— Ed25519 private key (keep secret, never commit).var/keys/backup-sign.nacl.pub— local Ed25519 public key.~/.config/lyta-shield/trusted-backup.pub— external verification trust anchor. Override withLYTA_BACKUP_PUBLIC_KEYwhen isolation requires another path.
The private key must be one regular file with exact mode 0600; symlinks and partial keypairs are rejected. Explicit rotation with scripts/rotate-backup-key.py updates the keypair and trust anchor. Create a fresh backup immediately afterward because backups signed by the retired key no longer verify against the new anchor.
bin/lyta-shield restore-baselineatomically creates a repository-relative SHA-256 baseline for the protected file set.bin/lyta-shield doctorchecks the baseline, backup status, and circuit breaker.bin/lyta-shield self-healatomically restores exact baseline bytes and preserves the trusted file mode.bin/lyta-shield incidentlogs security events tovar/incidents/.
- Daily backup:
lyta-shield-daily-backupat 06:30. - Weekly verification:
lyta-shield-weekly-verifyon Sundays at 07:00. - Daily self-audit:
lyta-shield-daily-self-auditat 06:00. - Doctor/heal:
lyta-shield-doctor-healevery 10 minutes.
See self-audit-log.md for historical incidents and self-audit results.