Document Purpose: Human Review & Publication Roadmap
Target Audience: Harisfazillah Jamel (LinuxMalaysia), Lead Architects, and Open-Source Community
Ecosystem Target: Guardrails AI PyPI Ecosystem (guardrails-ai-<name>) & DSOM Native Runtime
Status: Draft for Final Review | OKF v0.2 Compliant
Live URL:https://linuxmalaysia.github.io/deep-state-of-mind-for-my-ai/governance/DSOM-GUARDRAILS-CATALOG-SUBMISSION-REVIEW/
π 1. Executive Summary & Hub Transition Note
This document presents the complete catalog of 10 specialized AI Guardrails engineered for the Deep State of Mind (DSOM) protocol. Each guardrail protects a distinct vector of autonomous agent operation, digital sovereignty, token conservation, and GitOps hygiene.β οΈ Critical Upstream Notice (Guardrails AI Hub Transition):
As documented in the official Guardrails AI architecture updates:- The Centralized Hub Cutoff: Guardrails AI has transitioned away from the centralized
guardrails hub installprivate registry towards standard standalone Python packages on PyPI (guardrails-ai-<validator-name>). - Contribution & Publishing Model: We package our custom validators as open-source PyPI packages using standard Python build tooling (
uv build,flit, orhatchling), allowing any developer in the global Guardrails AI community to install them viauv add guardrails-ai-dsom-<validator>.
ποΈ 2. The Complete DSOM 10-Guardrail Inventory
Below is the exhaustive inventory of all guardrails required to guarantee 100% compliance with the DSOM protocol.1οΈβ£ Guardrail 1: OKF Frontmatter & UTF-8 BOM Stripper (guardrails-ai-dsom-okf-bom)
- DSOM Rule Reference: Rule 2 & Rule 25 (Open Knowledge Format & GitHub Web Compatibility).
- Threat Vector: Windows editors and raw LLM text generation inserting hidden UTF-8 Byte Order Marks (
\xef\xbb\xbf) and missing opening YAML frontmatter fences (---), which breaks GitHub web rendering and downstream parser scripts. - Validation Logic:
- Inspects raw string start.
- If
\ufeffis detected, strips it immediately (on_fail="fix"). - Asserts line 1 starts with
---.
- Guardrails AI Class:
GuardrailsOKFBOMValidator - On-Fail Actions:
fix(automatically strips BOM and normalizes fence) orfail.
2οΈβ£ Guardrail 2: OKF v0.2 Provenance & Trust Signal Gate (guardrails-ai-dsom-okf-trust)
- DSOM Rule Reference: Rule 6 & Rule 21 (Opportunistic OKF v0.2 Migration & Temporal Verification).
- Threat Vector: LLMs creating or updating documentation without provenance metadata, leading to unverified hallucinations and stale architectural drift.
- Validation Logic:
- Parses YAML frontmatter into a dictionary.
- If
okf_version: 0.2, asserts all 6 trust fields exist:sources(list),generated(string),verified(bool),status(string),stale_after(ISO timestamp),topics(list of 3-5 tags).
- Guardrails AI Class:
GuardrailsOKFTrustValidator - On-Fail Actions:
reask(prompts LLM to supply missing source links and verification status).
3οΈβ£ Guardrail 3: Sovereign Signature & Modification Date Auditor (guardrails-ai-dsom-sovereign-signature)
- DSOM Rule Reference: Rule 13 (Sovereign Signature & Modification Date Mandate).
- Threat Vector: Agents modifying markdown documents without refreshing the explicit footer signature date, causing human operators and peer agents (Jules/Antigravity) to lose track of document freshness.
- Validation Logic:
- Inspects the last 3 lines of markdown text.
- Verifies presence of the standard DSOM footer:
*Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | YYYY-MM-DD*. - Verifies that
YYYY-MM-DDmatches the current session date.
- Guardrails AI Class:
GuardrailsSovereignSignatureValidator - On-Fail Actions:
fix(automatically appends or updates the date signature) orfail.
4οΈβ£ Guardrail 4: Defensive Credential & Secret Interceptor (guardrails-ai-dsom-credential-guardian)
- DSOM Rule Reference: Rule 24 (Defensive Credential Handling Mandate).
- Threat Vector: Agents or human prompts inadvertently pasting GitHub tokens (
ghp_*), GitLab tokens (glpat-*), AWS keys (AKIA*), or SSH/RSA Private Keys into persistent files or chat logs. - Validation Logic:
- Runs high-performance regular expressions across all output text and tool parameters.
- Blocks execution instantly if an API key or private key pattern is detected.
- Guardrails AI Class:
GuardrailsCredentialGuardian - On-Fail Actions:
exception/block(refuses to proceed and advises human to rotate keys).
5οΈβ£ Guardrail 5: Isolated Python Execution & Tool Gatekeeper (guardrails-ai-dsom-uv-gatekeeper)
- DSOM Rule Reference: Rule 16 (The
uvIsolated Execution Mandate). - Threat Vector: Agents running unmanaged
pip install,python, orpython3commands, polluting system Python and risking PATH hijacking on Windows. - Validation Logic:
- Inspects CLI invocation commands.
- Intercepts and blocks commands containing
pip,python, orpython3. - Suggests
uv runoruv add.
- Guardrails AI Class:
GuardrailsUVExecutionValidator - On-Fail Actions:
fix(rewritespip install Xtouv add X) orblock.
6οΈβ£ Guardrail 6: Byte-Capped Terminal Output Interceptor (guardrails-ai-dsom-byte-cap)
- DSOM Rule Reference: Rule 10 (Byte-Capped Executions & Context Window Defense).
- Threat Vector: Commands returning massive payloads (e.g.
cat 50MB.logor verbose build logs) that flood the LLM context window, triggering token budget exhaustion and memory amnesia. - Validation Logic:
- Inspects terminal command outputs or tool string returns.
- Measures token/byte size.
- Truncates text exceeding 4,000 bytes and appends a
[TRUNCATED BY DSOM BYTE-CAP GUARDRAIL]notice.
- Guardrails AI Class:
GuardrailsByteCapValidator - On-Fail Actions:
fix(programmatically truncates and preserves context budget).
7οΈβ£ Guardrail 7: Granular Atomic Git Commit Enforcer (guardrails-ai-dsom-atomic-commit)
- DSOM Rule Reference: Rule 4 (Git Sovereignty & Atomic Commits).
- Threat Vector: Agents running blanket
git commit -am "update"or staging all unrelated files across the entire repo in one monolithic commit. - Validation Logic:
- Inspects Git commands before execution.
- Blocks
git commit -amor commits with non-semantic messages (e.g., βfixed stuffβ, βwipβ). - Requires semantic Conventional Commit format (
feat(...),docs(...),fix(...),refactor(...)).
- Guardrails AI Class:
GuardrailsAtomicCommitValidator - On-Fail Actions:
block(instructs agent to stage files logically and write semantic messages).
8οΈβ£ Guardrail 8: Skill Token Window Gatekeeper (guardrails-ai-dsom-skill-token-gate)
- DSOM Rule Reference: Rule 19 (Skill Modification Quality Gate & Progressive Disclosure).
- Threat Vector: AI agents authoring massive
SKILL.mddocuments (>4,000 tokens) that bloat context windows when semantic discovery triggers. - Validation Logic:
- Uses
tiktoken(cl100k_base or o200k_base) to measureSKILL.mdpayload token counts. - Blocks any skill exceeding 4,000 tokens.
- Enforces offloading reference blocks to a
references/subdirectory.
- Uses
- Guardrails AI Class:
GuardrailsSkillTokenGate - On-Fail Actions:
block(forces agent to offload detailed tables toreferences/).
9οΈβ£ Guardrail 9: Knowledge-First AST Discovery Interceptor (guardrails-ai-dsom-knowledge-first)
- DSOM Rule Reference: Rule 20 & Rule 21 (Local Knowledge-First Discovery Protocol).
- Threat Vector: Agents jumping straight to terminal probe commands or external web queries without first checking local OKF documentation and spatial brain state.
- Validation Logic:
- Intercepts task initialization.
- Verifies that the agent has performed
grep_searchon.agents/brain/ordocs/before executing system commands.
- Guardrails AI Class:
GuardrailsKnowledgeFirstValidator - On-Fail Actions:
reask(prompts agent: βYou must search local OKF memory first before executing OS commandsβ).
π Guardrail 10: Root Workspace Cleanliness & SaaS Isolation Guard (guardrails-ai-dsom-root-cleanliness)
- DSOM Rule Reference: Rule 17 (Root Workspace Cleanliness Mandate).
- Threat Vector: Agents dumping scratch files, temporary logs, or ad-hoc scripts into the repository root instead of
.agents/,docs/, ortools/. - Validation Logic:
- Checks target file paths for write operations.
- Permits only core governance files (
README.md,SUMMARY.md,START-HERE.md,llms.txt,.gitignore,ansible.cfg) and SaaS verification files (context7.json). - Redirects all other docs to
docs/and tools totools/.
- Guardrails AI Class:
GuardrailsRootCleanlinessValidator - On-Fail Actions:
fix(redirects file path to appropriate subdirectory) orblock.
π¦ 3. Packaging & PyPI Publishing Architecture
To distribute these guardrails to the broader AI community and the Guardrails AI ecosystem, we organize them into an open-source mono-package with individual plugin exports:Package Naming & Layout:
PyPI Installation:
Universal Usage in Any Guardrails AI Application:
π 4. Next Steps for Human Review & Release
π SOURCES
- Guardrails AI Official Documentation - Upstream architecture and validator development guide.
- The Master Guide to AI Guardrails & Custom Validators - Theoretical and technical foundation.
- The Core AI Rulebook (DSOM) - Sovereign rules 2, 4, 6, 10, 13, 16, 17, 19, 20, 24, 25, and 29.
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-08-22
Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0