[MASTER SYSTEM DIRECTIVE SPECIFICATION :: v9.2]

DETERMINISTIC AI SYSTEMS ENGINEERING

How I applied formal AI Systems Engineering best practices and first-principles mathematical variable control (defined in my System Glossary) to tether a probabilistic AI Engine:
Architectural Insight: Why My System Directive Operates Like a Compiler
A traditional code compiler takes human instructions, verifies that every variable and boundary rule is valid, and refuses to build the program if a single dependency is missing. My Zero Trust Interactive State Machine works on that exact engineering principle: in Phases 1 and 2, my System Directive forces The AI Engine to verify my Entra ID Tenant ID, Azure Subscription ID, Resource Group, and exact Code Repository and Branch spelling with me in my local terminal before it is permitted to synthesize my IaC Payload and Terminal Runbook in Phase 3.

Anatomy of the Zero Trust Interactive State Machine

Instead of relying on an open-ended prompt, my Zero Trust Interactive State Machine (v9.2) is governed by a structured master System Directive divided into three architectural layers:
  • Layer 1 (The Tethered Compute Engine): Subordinates The AI Engine to my human sign-off so it can only output terminal lookup queries in Phases 1 and 2 and synthesize my IaC Payload in Phase 3 after my coordinates are locked.
  • Layer 2 (The 7-Phase State Machine Harness): Enforces mandatory phase halts, a continuous Watchdog turn check, and strict separation between hard execution constraints and passive UI presentation strings.
  • Layer 3 (Two-Stage Verification & Continuous Improvement): Enforces the Phase 4 Identity Architecture Ledger (IAL), Validation Bridge, and Azure Portal Monitoring Metrics (Total Service API Hits), followed by the Phase 5 Audit Results Ledger (ARL), KQL Telemetry, and Defect & Patch Ledger (DPL), and Phase 7 System Directive Compilation.
[LAYER 01 : THE AI ENGINE]

The Tethered Co-Pilot

  • Zero Direct Cloud Access: The AI Engine has zero direct network access to my Entra ID Tenant ID or Azure Subscription ID and cannot execute commands on its own.
  • Lookups Before Synthesis: In Phases 1 and 2, it outputs read-only terminal lookup scripts so I can extract my real cloud and Execution Agent IDs. Only in Phase 3 does it synthesize the finished Terraform, Azure Bicep, or PowerShell REST API IaC Payload and Terminal Runbook.
[LAYER 02 : THE STATE MACHINE]

7 Phases & Strict Rules

  • Mandatory Halts & Watchdog Check: The State Machine paces my build across 7 sequential phases with strict human-in-the-loop halts and a continuous Watchdog self-check on every turn.
  • Presentation Subordination: Isolates passive telemetry table headers inside fenced XML blocks so cosmetic display text can never override a mechanical security rule across Gate 1 through Gate 4.
[LAYER 03 : BUILT-IN VERIFICATION]

Two-Stage Proof & Ledgers

  • Phase 4 Baseline & Metrics: Generates the Identity Architecture Ledger (IAL), runs the Validation Bridge on my Execution Agent, and verifies live access via Azure Portal Monitoring Metrics (Total Service API Hits) on my Data-Plane Asset.
  • Phase 5 & Phase 7 Evolution: Generates the Audit Results Ledger (ARL), KQL Telemetry (kql_telemetry.md), and Defect & Patch Ledger (DPL) in Phase 5, and compiles all upgrades into my System Directive in Phase 7.

Matching System Complexity & Mathematical Precision in Cloud IAM

The true engineering challenge in enterprise Cloud IAM is matching system complexity with 100% mathematical precision across every moving part:
  • Combinatorial Complexity Across 5 Coordinates: Securing a non-human machine identity requires aligning 1 Identity Core (Microsoft Entra ID), 4 Execution Agents, 2 Infrastructure States, 3 Data-Plane Assets, and 3 IaC Payload languages (72 baseline build combinations plus 35 Day-2 Microsoft Entra ID security modules).
  • Zero Margin for Error Across Gates 1 to 4: If a single capital letter in the Code Repository and Branch spelling inside the Gate 3 Subject Claim is off, or if a Gate 4 Data-Plane Role is mis-scoped, the deployment either fails with an access denial or leaves a security gap.
  • Tight, Mathematically Proper Configurations: Tethering The AI Engine to my Zero Trust Interactive State Machine ensures that every coordinate, Subject Claim, 30-Second Server Sync Timer, and single-asset Data-Plane Role is verified against my live cloud environment before execution.
[OBJECTIVE 01 : MATHEMATICAL PRECISION]

Exact OIDC & Day-2 Synthesis

  • Passwordless Gate 3 Federation: Synthesizes complete OpenID Connect (OIDC) configurations where my Execution Agent trades its wildcard-free Subject Claim for a 60-Minute Login Token on my Service Principal.
  • 35 Day-2 Entra ID Expansions: Layers advanced capabilities (such as Conditional Access for Workload Identities with IPv4 chunking) onto my verified Application Registration and Service Principal.
[OBJECTIVE 02 : ZERO AI GUESSWORK]

100% Verified Cloud IDs

  • Live Terminal Extraction: Replaces AI guessing with read-only terminal lookups in Phases 1 and 2 to lock in my real Entra ID Tenant ID, Azure Subscription ID, Resource Group, and Code Repository and Branch spelling.
  • Hard Gate Enforcement: Enforces Brownfield (Existing) read-only lookups, Greenfield (Net-New) deletion-prevention locks, pinned versions, and single-asset Data-Plane Roles.
[OBJECTIVE 03 : 72 BUILD COMBINATIONS]

Adapting to Any Stack

  • Dynamic Coordinate Branching: Automatically adjusts Phase 2 terminal lookups, the Gate 3 Subject Claim format, the Gate 4 Data-Plane Role, and the Phase 4 Validation Bridge to match my 5 Build Coordinates.
  • Uniform Zero Trust Baseline: Maintains the exact same mathematical security standard across all 72 baseline build combinations.

The Four Pillars of My System Directive

To turn a probabilistic language model into a deterministic engineering co-pilot, I built my master System Directive (v9.2) on four globally recognized AI Systems Engineering standards:
  • Industry Standard vs. My Implementation: Each card below separates what the foundational AI Systems Engineering standard defines in the broader AI industry from how I wired it into my 7-phase workflow at the keyboard, followed by the primary research citation.
[PILLAR 01 :: TERMINAL VERIFICATION & REAL-TIME DPL LOGGING]

1. Agentic Patterns (The ReAct Framework)

  • The AI Systems Engineering Standard: Asking a model to write a complex cloud deployment in one shot ("zero-shot prompting") forces it to guess missing environment details. Developed by researchers at Princeton and Google Brain, the ReAct (Reasoning and Acting) methodology prevents hallucination by forcing models to alternate between reasoning steps and checking real external data sources.
How I Applied It in My System Directive (Phases 1 to 2 & All-Phase DPL)
  • Phase 1 & 2 Terminal Lookups: Before writing any code, The AI Engine pauses and gives me read-only terminal lookup commands so I can extract my real Entra ID Tenant ID, Azure Subscription ID, Resource Group, and exact Code Repository and Branch spelling from my Execution Agent.
  • Standard Patch Loop & State Re-Sync (Iterations 1 to 3): If an error occurs at any phase, The AI Engine enters clinical diagnostic mode for up to 3 attempts. Once I verify a fix in my local terminal, it logs the root cause and fix immediately in the Defect & Patch Ledger (DPL) and performs a full-file State Re-Sync of my entire IaC Payload.
Reference Standard
ReAct: Synergizing Reasoning and Acting in Language Models (Yao et al.)

Foundational research from Princeton and Google Brain demonstrating that language models stop hallucinating when forced to alternate between reasoning traces and external environment lookups.

[View Research] ↗
[PILLAR 02 :: PERMISSION & MFA SAFETY LOCKS]

2. Bounded Autonomy (OWASP LLM08)

  • The AI Systems Engineering Standard: When an untethered model hits an access denial or multi-factor authentication error, it frequently attempts to bypass the error by granting broad administrative roles or overwriting live resources. OWASP LLM08 (Excessive Agency) mandates strict permission boundaries so a model cannot exercise unchecked agency.
How I Applied It in My System Directive (Phase 3 / Gates 1, 2 & 4)
  • Asset & Role Locks: The State Machine enforces read-only lookups on Brownfield (Existing) Data-Plane Assets, deletion-prevention locks on Greenfield (Net-New) Data-Plane Assets, Single-Tenant Application Registrations and Service Principals, and single-asset Data-Plane Roles (blocking Owner and Contributor Roles).
  • Azure Portal MFA Handoff: When a Conditional Access or PowerShell REST API build requires an interactive MFA popup to assign a Gate 4 Data-Plane Role (which local terminals drop), The State Machine separates the Data-Plane Role step from the IaC Payload and gives me a guided Azure Portal MFA Handoff checklist so the build never crashes.
Reference Standard
OWASP Top 10 for LLM Applications (LLM08: Excessive Agency)

The global application security standard for preventing artificial intelligence models from exercising unchecked permissions or executing destructive actions across enterprise infrastructure.

[View Framework] ↗
[PILLAR 03 :: STEP-BY-STEP HUMAN APPROVAL]

3. Human-in-the-Loop Governance (NIST AI RMF)

  • The AI Systems Engineering Standard: In enterprise cloud security, a human architect must remain accountable for every change made to the directory. The NIST Artificial Intelligence Risk Management Framework (AI RMF 1.0) establishes the "Govern" function, requiring continuous human oversight and explicit sign-off at every critical decision gate.
How I Applied It in My System Directive (Phases 1 to 7)
  • Strict Phase Halts: My System Directive forbids The AI Engine from skipping phases or stacking sequential manual tasks in a single prompt. Every phase ends with a mandatory halt awaiting my confirmation.
  • Workspace Forecast & Coordinate Echo: Before outputting my Phase 3 IaC Payload, The State Machine lists the exact five deliverable files to initialize in Phase 1 and echoes back my verified Application Registration Client ID and Subject Claim template in Phase 3 for my explicit approval.
Reference Standard
NIST Artificial Intelligence Risk Management Framework (AI RMF 1.0)

The U.S. federal standard establishing the "Govern" function, requiring structured human oversight, risk control, and clear human accountability across high-impact AI systems.

[View Standard] ↗
[PILLAR 04 :: EMERGENCY HALT ON ITERATION 4 & PHASE 7 EVOLUTION]

4. Cognitive Circuit Breaking & Evolution

  • The AI Systems Engineering Standard: When a deployment script fails repeatedly during a long troubleshooting session, language models naturally lose track of earlier constraints and begin guessing in circles ("hallucination spirals"). Foundational AI reliability research proves the need for hard iteration limits and cognitive circuit breaking.
How I Applied It in My System Directive (All-Phase Circuit Breaker & Phase 7)
  • The 4-Iteration Circuit Breaker (Iteration 4 Halt): Active across every phase (separate from routine DPL logging during Iterations 1 to 3). If a single isolated error fails 3 times in a row and reaches Iteration 4, The 4-Iteration Circuit Breaker trips automatically: forbidding new code generation, analyzing the 3 failed tries, calculating an Estimated Probability of Success (X%), and presenting alternative pathways for my decision.
  • Phase 7 Continuous Improvement: At session close in Phase 7, The AI Engine outputs my statistical AI Performance Scorecard and compiles all verified DPL lessons permanently into my master System Directive.
Reference Standard
A Survey on Hallucination in Large Language Models (Huang et al.)

Comprehensive research documenting how language models drift from system instructions and repeat ungrounded guesses during multi-turn troubleshooting sessions.

[View Research] ↗

Translating AI Engineering into the 5 Enterprise Guardrails

How the four AI Systems Engineering pillars above are translated into five concrete security locks inside my generated code:
  • Runtime Code Enforcement: Enforced inside my Phase 3 IaC Payload, Terminal Runbook, and Phase 4 Validation Bridge across all 72 build combinations.
  • Audited in Phase 5: Formally verified and scored as [PASS] in my Phase 5 Audit Results Ledger (audit_results_ledger.md or ARL), alongside three built-in cloud bug preventions detailed below the table:
Engineering Goal Enterprise Guardrail How My System Directive Enforces It in Code Phase 5 ARL Check
Separating Routing IDs from Private Secrets 1. Secret & Credential Protection Phases 1, 2 & 3 / Gates 1, 2 & 3
  • Routing IDs Go In: My Entra ID Tenant ID, Azure Subscription ID, Resource Group, and Code Repository and Branch are resolved via terminal lookups in Phases 1 and 2 so The AI Engine writes a 100% finished IaC Payload in Phase 3 with zero blank placeholders.
  • Secrets Stay Out: OpenID Connect (OIDC) 60-Minute Login Tokens eliminate static passwords completely, and my Terminal Runbook uses invisible terminal input (read -s) so any setup token never appears on my screen or in my Code Repository and Branch.
[PASS : ARL]
Protecting Live Cloud Infrastructure 2. Existing Asset Protection Phases 2 & 3 / Gate 1 Boundary
  • Brownfield (Existing) Infrastructure State: Forces my Phase 3 IaC Payload into read-only lookup mode (Terraform data blocks or Azure Bicep existing keywords) and echoes back my existing Application Registration Client ID first so live Data-Plane Assets are never overwritten.
  • Greenfield (Net-New) Infrastructure State: Attaches deletion-prevention locks and persistent state storage rules so new Data-Plane Assets cannot be accidentally wiped out.
[PASS : ARL]
Single-Asset Data Permissions Only 3. Stopping "The Contributor Trap" Phases 3 & 5 / Gate 4 Access
  • Blocking Owner and Contributor Roles: Giving an Execution Agent Owner or Contributor access is like giving a delivery driver the master keys to remodel the building. Broad Owner and Contributor Roles are strictly blocked.
  • Single-Asset Data-Plane Role: Assigns one specific Data-Plane Role (such as Key Vault Secrets User) to my Service Principal, scoped strictly to the resource ID of my single Data-Plane Asset.
[PASS : ARL]
Locking In Verified Provider Versions 4. Supply Chain Version Pinning Phases 3 & 4 / IaC Payload & Validation Bridge
  • Pinned Versions: Rejects floating version tags (such as "latest") and pins every provider and API version in my Phase 3 IaC Payload and every login action in my Phase 4 Validation Bridge to an exact, verified version number.
  • Pure REST API Schemas: Enforces pure Microsoft Graph JSON property names when my chosen IaC Payload is PowerShell REST API so Terraform terms never bleed into raw API calls.
[PASS : ARL]
Scrubbing Tokens from Console Logs 5. Validation Bridge Runtime Log Masking Phases 4 & 5 / Validation Bridge & ARL
  • Active Output Scrubbing: Before my Execution Agent runs the Phase 4 Validation Bridge to trade its Subject Claim for a 60-Minute Login Token and read my Data-Plane Asset, my System Directive injects active Runtime Log Masking into the Validation Bridge file.
  • Zero Plaintext Exposure: Scrubs any sensitive 60-Minute Login Token or Data-Plane Asset value with asterisks (***) in memory before a single line prints to the console screen.
[PASS : ARL]

1. Preventing Microsoft Entra ID Sync Crashes

  • The Cloud Bug: When an IaC Payload creates a new Application Registration and Service Principal in Microsoft Entra ID (Gate 2) and immediately tries to attach an OpenID Connect (OIDC) Subject Claim or Conditional Access policy a split-second later (Gate 3), Microsoft's global directory servers often haven't finished syncing yet and the deployment crashes.
  • My Built-In Fix: My System Directive automatically injects a 30-Second Server Sync Timer into my Phase 3 IaC Payload between Gate 2 creation and Gate 3 attachment so Microsoft's directory servers catch up cleanly.

2. Preventing Subject Claim Casing Drops & IP Overflows

  • The Cloud Bug: Microsoft Entra ID rejects OpenID Connect (OIDC) token exchanges if a single capital or lowercase letter in the Subject Claim does not match my Code Repository and Branch spelling, and crashes if thousands of Execution Agent IPv4 ranges are fed into one Conditional Access policy block.
  • My Built-In Fix: Phase 2 extracts the exact capital-and-lowercase spelling of my Code Repository and Branch (such as CompCode1) via terminal lookup for the Subject Claim, and Phase 3 automatically chunks large IPv4 lists into safe blocks.

3. Beating Azure Portal Caching & Log Indexing Delays

  • The Cloud Bug: Azure Portal UI toggles suffer from browser caching delays, and Azure Log Analytics can take a long, unpredictable amount of time to index new sign-in logs.
  • My Built-In Fix: My System Directive mandates terminal audit scripts to verify policy states directly in Microsoft Entra ID before testing, and uses Two-Stage Live Verification: checking Azure Portal Monitoring Metrics (Total Service API Hits) on my Data-Plane Asset in Phase 4 for immediate proof before running asynchronous KQL Telemetry (kql_telemetry.md) in Phase 5.