Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:A5c ai Babysitter Context Bundle Assembly

From Leeroopedia
Knowledge Sources
Domains Kubernetes, Prompt_Engineering, Context_Assembly
Last Updated 2026-10-23 00:00 GMT

Overview

A method for assembling agent context bundles with prompt layers, secret redaction, size enforcement, and cryptographic digest computation.

Description

Context Bundle Assembly is the principle of collecting, redacting, and bounding the information an agent receives at dispatch time. The bundle consists of:

  • Prompt layers: system, developer, and task prompts from the AgentStack CRD, merged with skill and context label fragments.
  • Redaction: Five redaction pattern types (secret-key, provider-token, bearer-token, private-key, base64-credential) scrub secrets from all prompt layers.
  • Size enforcement: 64 KiB per layer, 750 KiB bundle max, 32 attachments max — prevents context overflow.
  • Digest: SHA-256 digest of the assembled bundle for integrity verification.

The composeAgentPrompt function composes a three-part prompt from soul, persona, definition, and stack CRDs.

Usage

Use this principle when dispatching AI agents where the prompt context must be redacted, bounded, and verifiable.

Theoretical Basis

The assembly is a pipeline:

1. Collect raw prompt layers (system, developer, task)
2. Merge skill fragments and context label fragments
3. Apply redaction patterns (ordered by priority)
4. Enforce size limits (truncate per layer, reject if bundle > 750 KiB)
5. Compute SHA-256 digest
6. Return ContextBundle { spec: { promptLayers, digest, size, redactionManifest, attachments } }

Key property: Redaction is applied before digest computation, ensuring the digest covers the redacted (safe) content, not the raw secrets.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment