Skip to content

dokugent preview

The preview command prepares an agent for certification by generating a secure, traceable, and tamper-evident preview file.

What it does

  • Deletes any existing preview file for the current agent
  • Writes a new preview output (.json)
  • Runs a security scan on preview files
  • Creates/updates the previews/latest symlink
  • Locks the preview file as read-only (chmod 444)
  • Creates a conventions.meta.json file with metadata for all selected convention files

Preview Output Structure

.dokugent/
└── ops/
    └── previews/
        β”œβ”€β”€ [agentId]/
        β”‚   β”œβ”€β”€ [agentId]@timestamp_preview.json
        └── latest/ β†’ symlink to latest folder

Security Enforcement

  • Runs blacklist/whitelist checks via a configurable scan
  • Prevents tampering by marking preview output as read-only

Example Usage

dokugent preview

Output:

🧠 Estimated Token Usage: 1020

πŸ” Running security scan in: .dokugent/ops/previews/latest

πŸ“„ Found 1 file to scan:
   .dokugent/ops/previews/latest/happybot@2025-05-24_19-15-55-492_preview.json

πŸ”’ Total files scanned: 1

βœ… No security issues detected.

πŸ’‘ Tip

To check for missing approval metadata (e.g., approvedBy, approvalDate) in your agent files, run:

dokugent security

This ensures your output isn’t just content-safe, but also policy-compliant.