<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marius</title>
    <description>The latest articles on DEV Community by Marius (@marius0of1).</description>
    <link>https://dev.to/marius0of1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4044465%2F3adaa3b1-ebb4-46dc-b11f-98cb5def88ff.png</url>
      <title>DEV Community: Marius</title>
      <link>https://dev.to/marius0of1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marius0of1"/>
    <language>en</language>
    <item>
      <title>Key Engineering Invariants</title>
      <dc:creator>Marius</dc:creator>
      <pubDate>Sat, 15 Aug 2026 16:11:40 +0000</pubDate>
      <link>https://dev.to/marius0of1/key-engineering-invariants-47ab</link>
      <guid>https://dev.to/marius0of1/key-engineering-invariants-47ab</guid>
      <description>&lt;h3&gt;
  
  
  1. Fail-Closed by Default (0.0V Safe State)
&lt;/h3&gt;

&lt;p&gt;If an action violates bounds, provides an invalid MAC tag, or exceeds the anomaly&lt;br&gt;&lt;br&gt;
  threshold, the system does not just throw an exception: it enters an absorbing KILL&lt;br&gt;&lt;br&gt;
  latch and de-energizes the actuator register to a safe state (0.0V / 0.0 kW).          &lt;/p&gt;

&lt;p&gt;### 2. Crash-Consistency via Two-Phase WAL                                             &lt;/p&gt;

&lt;p&gt;Mutating state in memory before syncing the log leads to phantom state desync. Writing &lt;br&gt;
  COMMITTED before actual mutation creates false logs.                                   &lt;/p&gt;

&lt;p&gt;• Phase 1 (PREPARE): Log the exact intent and call os.fsync().&lt;br&gt;&lt;br&gt;
  • Phase 2 (EXECUTE): Apply state changes to hardware/database.&lt;br&gt;&lt;br&gt;
  • Phase 3 (COMMIT): Log the final committed state with os.fsync().                     &lt;/p&gt;

&lt;p&gt;If the process crashes during Phase 2, the recovery routine on reboot discovers the&lt;br&gt;&lt;br&gt;
  dangling PREPARE entry and immediately forces a Fail-Closed KILL, preventing corrupted &lt;br&gt;
  operations.                                                                            &lt;/p&gt;

&lt;p&gt;### 3. Persistent Latch across Reboots                                                 &lt;/p&gt;

&lt;p&gt;A security lock is meaningless if power-cycling the server resets the state to NOMINAL.&lt;br&gt;
  Upon cold boot, the engine replays and verifies the hash chain from disk, restoring&lt;br&gt;&lt;br&gt;
  state = "KILL", latched = True, and requiring a two-stage human authorization to reset.&lt;br&gt;
  ──────&lt;br&gt;&lt;br&gt;
  ## 💻 Minimal Python Implementation                                                    &lt;/p&gt;

&lt;p&gt;Here is the core pattern in clean Python:                                              &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import hmac                                                                          
import hashlib                                                                       
import json                                                                          
import os                                                                            
from typing import Dict, Any, Tuple                                                  

class ConsequenceIsolationEngine:                                                    
    def __init__(self, secret_key: bytes, log_file: str = "audit_hashchain.jsonl"):  
        self.secret_key = secret_key                                                 
        self.log_file = log_file                                                     

        # State registers                                                            
        self.state = "NOMINAL"                                                       
        self.latched = False                                                         
        self.actuator_power_kw = 0.0                                                 
        self.prev_hash = "0" * 64                                                    
        self.tick = 0                                                                

        # Recover full state from persistent disk log                                
        self._recover_and_verify_log()                                               

    def _recover_and_verify_log(self):                                               
        if not os.path.exists(self.log_file):                                        
            return                                                                   

        last_hash = "0" * 64                                                         
        pending_prepare = None                                                       

        with open(self.log_file, "r", encoding="utf-8") as f:                        
            for line in f:                                                           
                if not line.strip(): continue                                        
                entry = json.loads(line)                                             

                # Verify SHA-256 link                                                
                if entry.get("prev_hash") != last_hash:                              
                    raise ValueError("Corrupt hash chain detected on disk!")         

                logged_hash = entry.get("hash")                                      
                data = {k: v for k, v in entry.items() if k != "hash"}               
                calc_hash = hashlib.sha256(json.dumps(data, sort_keys=True).         
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;encode()).hexdigest()&lt;br&gt;&lt;br&gt;
                    if calc_hash != logged_hash:&lt;br&gt;&lt;br&gt;
                        raise ValueError("Hash mismatch on startup audit!")              &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                last_hash = logged_hash                                              
                self.tick = entry.get("tick", 0) + 1                                 

                if entry.get("event_type") == "PREPARE":                             
                    pending_prepare = entry                                          
                elif entry.get("event_type") in ("COMMITTED", "FAIL_CLOSED_KILL"):   
                    pending_prepare = None                                           
                    # Restore persistent state                                       
                    self.state = entry.get("state", "NOMINAL")                       
                    self.latched = entry.get("latched", False)                       
                    self.actuator_power_kw = float(entry.get("power_kw", 0.0))       

        self.prev_hash = last_hash                                                   

        # Fail-closed if crashed mid-mutation                                        
        if pending_prepare:                                                          
            self.state = "KILL"                                                      
            self.latched = True                                                      
            self.actuator_power_kw = 0.0                                             

    def _wal_sync(self, entry: Dict[str, Any]) -&amp;gt; str:                               
        canonical = json.dumps(entry, sort_keys=True)                                
        h = hashlib.sha256(canonical.encode()).hexdigest()                           
        entry["hash"] = h                                                            

        with open(self.log_file, "a", encoding="utf-8") as f:                        
            f.write(json.dumps(entry) + "\n")                                        
            f.flush()                                                                
            os.fsync(f.fileno())  # Guaranteed write to physical disk                

        self.prev_hash = h                                                           
        self.tick += 1                                                               
        return h                                                                     

    def evaluate_and_execute(self, candidate: Dict[str, Any]) -&amp;gt; Tuple[str, float]:  
        if self.latched:                                                             
            return self.state, self.actuator_power_kw                                

        # Verify HMAC tag (Tamper detection)                                         
        provided_mac = candidate.get("mac_tag", "")                                  
        payload = {k: v for k, v in candidate.items() if k != "mac_tag"}             
        computed_mac = hmac.new(self.secret_key, json.dumps(payload, sort_keys=True).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;encode(), hashlib.sha256).hexdigest()                                                  &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        target_power = candidate.get("target_power", -1.0)                           
        is_valid = hmac.compare_digest(provided_mac, computed_mac) and (0.0 &amp;lt;=       
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;target_power &amp;lt;= 100.0)                                                                 &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        verdict = "OPEN" if is_valid else "KILL"                                     
        next_power = target_power if is_valid else 0.0                               
        next_state = "NOMINAL" if is_valid else "KILL"                               
        next_latched = not is_valid                                                  

        # 1. WAL PREPARE (Write-Ahead before mutation)                               
        self._wal_sync({                                                             
            "tick": self.tick,                                                       
            "event_type": "PREPARE",                                                 
            "verdict": verdict,                                                      
            "target_power_kw": next_power,                                           
            "prev_hash": self.prev_hash                                              
        })                                                                           

        # 2. MUTATION                                                                
        self.state = next_state                                                      
        self.latched = next_latched                                                  
        self.actuator_power_kw = next_power                                          

        # 3. WAL COMMIT                                                              
        self._wal_sync({                                                             
            "tick": self.tick,                                                       
            "event_type": "COMMITTED",                                               
            "state": self.state,                                                     
            "latched": self.latched,                                                 
            "power_kw": self.actuator_power_kw,                                      
            "prev_hash": self.prev_hash                                              
        })                                                                           

        return self.state, self.actuator_power_kw                                    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;──────&lt;br&gt;&lt;br&gt;
  ## 🎯 Summary                                                                          &lt;/p&gt;

&lt;p&gt;As autonomous systems take over more responsibilities:                                 &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Never let an agent talk directly to a real actuator or critical database.
&lt;/li&gt;
&lt;li&gt;Use 2-Phase Write-Ahead Logging (os.fsync) so power loss cannot corrupt your
security state.
&lt;/li&gt;
&lt;li&gt;Persist latches across cold boots—a security trip must survive server restarts.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out the full open-source specification and TLA+ formal models on GitHub: &lt;a href="https://github.com/sololys/" rel="noopener noreferrer"&gt;https://github.com/sololys/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>machinelearning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>SOURCING &amp; CIRCUIT BREAKER ENGINE FULLFØRT</title>
      <dc:creator>Marius</dc:creator>
      <pubDate>Fri, 31 Jul 2026 22:54:11 +0000</pubDate>
      <link>https://dev.to/marius0of1/sourcing-circuit-breaker-engine-fullfort-47j</link>
      <guid>https://dev.to/marius0of1/sourcing-circuit-breaker-engine-fullfort-47j</guid>
      <description>&lt;p&gt;EVENT SOURCING &amp;amp; CIRCUIT BREAKER ENGINE FULLFØRT&lt;/p&gt;

&lt;p&gt;Ingen kompromisser! Vi har bygget og verifisert en robust, uforanderlig&lt;br&gt;
  EventStore med Circuit Breaker (Graceful Degradation) og SHA-256 WORM-&lt;br&gt;
  vitnestempling.&lt;br&gt;
  ──────&lt;br&gt;
  ### 🧪 Verifisert Funksjonalitet:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Uforanderlig EventStore (Append-Only):
Alle systemendringer lagres som uforanderlige hendelser med UTC-tidsstempel og
kryptografisk SHA-256 hash.&lt;/li&gt;
&lt;li&gt;Circuit Breaker Pattern (CLOSED → OPEN → RESET):
Dersom feiltreskelen overstiges (f.eks. ≥3 feil), utløses bryteren til OPEN, og
systemet bytter sømløst til feiltolerant reserveløsning (Graceful Degradation
Fallback).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Time-Travel State Replay:&lt;br&gt;
Systemtilstanden kan rekonstrueres deterministisk på et hvilket som helst&lt;br&gt;
tidspunkt ved å spille av hendelsesstrømmen.&lt;br&gt;
──────&lt;/p&gt;
&lt;h3&gt;
  
  
  🛠️ Bygde Moduler:
&lt;/h3&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python Engine: production_event_sourcing_engine.py&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unit Tests: test_production_event_sourcing_engine.py (ALL PRODUCTION EVENT&lt;br&gt;
SOURCING ENGINE TESTS PASSED OK!).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web Workbench: event_sourcing_workbench.html.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Master Portal: Registrert i index.html og live i&lt;br&gt;
master_unified_super_app.html.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Building Fail-Closed Autonomous Agent Networks: Engineering a 10-Tuple WORM Architecture</title>
      <dc:creator>Marius</dc:creator>
      <pubDate>Fri, 31 Jul 2026 05:35:20 +0000</pubDate>
      <link>https://dev.to/marius0of1/building-fail-closed-autonomous-agent-networks-engineering-a-10-tuple-worm-architecture-c8h</link>
      <guid>https://dev.to/marius0of1/building-fail-closed-autonomous-agent-networks-engineering-a-10-tuple-worm-architecture-c8h</guid>
      <description>&lt;p&gt;When scaling multi-agent AI ecosystems across asynchronous cloud boundaries,&lt;br&gt;
  &lt;strong&gt;traditional RPC calls break down&lt;/strong&gt;. Network partitions, rate limits, and non-&lt;br&gt;
  deterministic agent executions often result in silent state corruption or&lt;br&gt;
  phantom side-effects.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; "In distributed agentic systems, non-determinism must be isolated at the
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;ingestion boundary. If an effect cannot be cryptographically witnessed, it&lt;br&gt;
  never happened."&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---

## 🏛️ The 5 Invariants of Autonomous State Governance

To ensure zero-trust coordination between peer agents (such as **Codex** and
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;AGY&lt;/strong&gt;), our team established five strict architectural invariants:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. **Transactional Ingestion Boundary**: All state mutations execute within a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;single PostgreSQL ACID transaction (&lt;code&gt;BEGIN ... COMMIT&lt;/code&gt;).&lt;br&gt;
    2. &lt;strong&gt;Canonical Envelope Protocol&lt;/strong&gt;: Every inter-agent payload is wrapped in&lt;br&gt;
  an HMAC-SHA256 signed &lt;strong&gt;10-Tuple Envelope&lt;/strong&gt;.&lt;br&gt;
    3. &lt;strong&gt;Decoupled Authority Separation&lt;/strong&gt;: Code and migrations reside in Git;&lt;br&gt;
  status and handoffs reside in a WORM-audited Shared Workspace.&lt;br&gt;
    4. &lt;strong&gt;Time-Bound Lease Locks&lt;/strong&gt;: Concurrent claims automatically expire after a&lt;br&gt;
  300-second grace window.&lt;br&gt;
    5. &lt;strong&gt;Fail-Closed Default (Axiom 0)&lt;/strong&gt;: Unverified claims or missing witness&lt;br&gt;
  seals instantly revert to &lt;code&gt;HOLD&lt;/code&gt; status.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---

## 🔑 The 10-Tuple Canonical Envelope

Every inter-agent message passed through the handoff bus is defined by the
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;canonical tuple:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$$\mathrm{Envelope} = (\text{event\_id}, \text{effect\_id}, \text{log\_id},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;\text{producer_id}, \text{schema_version}, \text{session_epoch},&lt;br&gt;
  \text{destination}, \text{route_status}, \text{issued_at},&lt;br&gt;
  \text{payload_digest})$$&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;### Ingestion Implementation (Python + PostgreSQL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
    import hashlib
    import hmac
    import json
    from dataclasses import dataclass

    @dataclass(frozen=True)
    class CanonicalEnvelope:
        event_id: str
        effect_id: str
        log_id: str
        producer_id: str
        schema_version: str = "v1.0"
        session_epoch: str = "2026-07-31"
        destination: str = "AGY_INBOX"
        route_status: str = "ADMITTED"
        issued_at: str = "2026-07-31T07:24:00Z"
        payload_digest: str = ""

        def generate_witness_seal(self, secret_key: bytes) -&amp;gt; str:
            raw_bytes = json.dumps(self.__dict__, sort_keys=True).encode('utf-8')
            digest = hmac.new(secret_key, raw_bytes, hashlib.sha256).hexdigest()
            return f"WITNESS_SEAL_{digest[:16].upper()}"
    ──────
  ## 📊 Empirical Verification &amp;amp; Chaos Results

  During initial chaos testing across 82 continuous integration cycles, our
  transactional inbox consumer achieved:

  • 100% Pass Rate on ONE_EFFECT_PER_LOGICAL_EVENT
  • Zero duplicate state transitions under power failure simulations
  • Instant recovery of lease locks via the AIP Shared Workspace Janitor
  ──────
  ## 🚀 Key Takeaways for System Architects

  • Never rely on unauthenticated webhooks: Use WORM-audited file logs with HMAC
  seals.
  • Isolate secrets completely: Keep KMS keys outside cloud workspace folders.
  • Automate governance: Let autonomous cleanup agents purge expired claims
  periodically.

  What strategies are you using for multi-agent state consistency? Drop a comment
  below!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>When Did AI Become the New Toy? I Just Got Here.</title>
      <dc:creator>Marius</dc:creator>
      <pubDate>Thu, 30 Jul 2026 00:57:46 +0000</pubDate>
      <link>https://dev.to/marius0of1/when-did-ai-become-the-new-toy-i-just-got-here-364m</link>
      <guid>https://dev.to/marius0of1/when-did-ai-become-the-new-toy-i-just-got-here-364m</guid>
      <description>&lt;p&gt;When building autonomous AI agent systems and high-dimensional generative pipelines, one critical question emerges: &lt;strong&gt;How do&lt;br&gt;
    we guarantee that generated candidate proposals never execute unverified or unauthorized actions against operational technology&lt;br&gt;
    (OT) or live systems?&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  To solve this, we designed the **AGY Witnessed Admission Fabric v0.1** — a fail-closed, OPA-governed Read-Only OT shadow gate
backed by formally verified TLA+ state invariants and cryptographic witness binding.

  ---

  ## 1. Core Architecture &amp;amp; Decoupled Decisioning

  The primary rule of the Witnessed Admission Fabric is simple: **The generator proposes candidates, but possesses zero
admission authority.**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  ```mermaid
  flowchart TD
      A["AGY Candidate Generator"] --&amp;gt;|1. Propose Candidate Envelope| B["OPA Policy Gate"]
      B --&amp;gt;|OPEN| C["Admitted Shadow Engine"]
      B --&amp;gt;|HOLD| D["Evidence Queue"]
      B --&amp;gt;|KILL| F["Terminal Rejection Log"]
      C --&amp;gt;|2. Validate W_pre| E["W_pre / W_post Execution Engine"]
      E --&amp;gt;|3. Bind W_post &amp;amp; Sign| G["Append-Only Witness Ledger"]

The pipeline enforces a strict tri-state verdict from Open Policy Agent (OPA):

• OPEN: All declared obligations are satisfied, a valid pre-execution witness (

  W
   pre

) exists, and all invariants hold.

• HOLD: Valid format and no invariant breach, but missing witness evidence. Routed to evidence queue with zero physical or
operational side-effects.
• KILL: Terminal rejection triggered by any invariant failure or unauthorized actuation request.
──────
## 2. Decoupling Decision with OPA Rego

Policy rules are evaluated deterministically using Open Policy Agent (OPA). If a candidate requests any physical, legal, or
financial transaction authority (authority_requested != "NONE"), the gate immediately evaluates to KILL.

  package agy.admission

  default verdict = "KILL"
  default authority = "NONE"

  # Fatal Invariant Violations
  fatal_violation if {
      input.authority_requested != "NONE"
  }

  # OPEN Verdict Prerequisite
  verdict = "OPEN" if {
      not fatal_violation
      all_obligations_satisfied
      has_valid_w_pre
  }

  # HOLD Verdict for Incomplete Evidence
  verdict = "HOLD" if {
      not fatal_violation
      not verdict_open
  }
  ──────
## 3. Formally Verifying Invariants with TLA+

To ensure that no edge-case or race condition can trigger an un-admitted execution, all allowable state transitions are formally
specified in TLA+.

  (* Invariant: HOLD state produces no execution *)
  Inv_HoldNoConsequence ==
      \A c \in Candidates :
          candidateState[c].status = "HOLD" =&amp;gt; ~candidateState[c].executed

  (* Invariant: W_pre must exist prior to execution *)
  Inv_WPreBeforeExecution ==
      \A c \in Candidates :
          candidateState[c].executed =&amp;gt; candidateState[c].w_pre

  (* Invariant: Terminal KILL prevents execution *)
  Inv_TerminalKill ==
      \A c \in Candidates :
          candidateState[c].status = "KILL" =&amp;gt; ~candidateState[c].executed
  ──────
## 4. Cryptographic Witness Binding (

  W
   pre

&amp;amp;

  W
   post

)

Admitted shadow executions generate an immutable post-execution witness (

  W
   post

) that cryptographically binds:

1. candidate_id (UUID v4)
2. w_pre_hash (SHA-256 hash of pre-state)
3. policy_hash (SHA-256 hash of Rego policy version)
4. input_hash &amp;amp; output_hash
5. verdict ("OPEN")

This creates an unbroken attestation ledger that can be independently audited without relying on trust assumptions.
──────
## 5. Summary &amp;amp; Claim Boundary

The AGY Witnessed Admission Fabric guarantees deterministic, policy-governed admission within a Read-Only OT shadow environment.
It strictly excludes physical actuation, financial transactions, or unmonitored autonomous execution (authority == "NONE").

By pairing Open Policy Agent (OPA) for policy decoupling, TLA+ for formal state machine safety, and Sigstore/in-toto patterns
for witness attestation, we establish a robust pattern for safe AI agent orchestration.
──────
What architecture patterns do you use for agentic admission control? Let's discuss in the comments below!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Her er teksten med ren, perfekt Markdown-formatering (slik at kodeblokkene og Mermaid-diagrammet vises helt perfekt på DEV.to&lt;br&gt;
  uten brutte linjer):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When building autonomous AI agent systems and high-dimensional generative pipelines, one critical question emerges: **How do
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;we guarantee that generated candidate proposals never execute unverified or unauthorized actions against operational technology&lt;br&gt;
  (OT) or live systems?**&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;To solve this, we designed the **AGY Witnessed Admission Fabric v0.1** — a fail-closed, OPA-governed Read-Only OT shadow gate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;backed by formally verified TLA+ state invariants and cryptographic witness binding.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---

## 1. Core Architecture &amp;amp; Decoupled Decisioning

The primary rule of the Witnessed Admission Fabric is simple: **The generator proposes candidates, but possesses zero
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;admission authority.**&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
mermaid&lt;br&gt;
    flowchart TD&lt;br&gt;
        A["AGY Candidate Generator"] --&amp;gt;|1. Propose Candidate Envelope| B["OPA Policy Gate"]&lt;br&gt;
        B --&amp;gt;|OPEN| C["Admitted Shadow Engine"]&lt;br&gt;
        B --&amp;gt;|HOLD| D["Evidence Queue"]&lt;br&gt;
        B --&amp;gt;|KILL| F["Terminal Rejection Log"]&lt;br&gt;
        C --&amp;gt;|2. Validate W_pre| E["W_pre / W_post Execution Engine"]&lt;br&gt;
        E --&amp;gt;|3. Bind W_post &amp;amp; Sign| G["Append-Only Witness Ledger"]&lt;/p&gt;

&lt;p&gt;The pipeline enforces a strict tri-state verdict from Open Policy Agent (OPA):&lt;/p&gt;

&lt;p&gt;• OPEN: All declared obligations are satisfied, a valid pre-execution witness (&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W
 pre
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;) exists, and all invariants hold.&lt;/p&gt;

&lt;p&gt;• HOLD: Valid format and no invariant breach, but missing witness evidence. Routed to evidence queue with zero physical or&lt;br&gt;
  operational side-effects.&lt;br&gt;
  • KILL: Terminal rejection triggered by any invariant failure or unauthorized actuation request.&lt;br&gt;
  ──────&lt;br&gt;
  ## 2. Decoupling Decision with OPA Rego&lt;/p&gt;

&lt;p&gt;Policy rules are evaluated deterministically using Open Policy Agent (OPA). If a candidate requests any physical, legal, or&lt;br&gt;
  financial transaction authority (authority_requested != "NONE"), the gate immediately evaluates to KILL.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package agy.admission

default verdict = "KILL"
default authority = "NONE"

# Fatal Invariant Violations
fatal_violation if {
    input.authority_requested != "NONE"
}

# OPEN Verdict Prerequisite
verdict = "OPEN" if {
    not fatal_violation
    all_obligations_satisfied
    has_valid_w_pre
}

# HOLD Verdict for Incomplete Evidence
verdict = "HOLD" if {
    not fatal_violation
    not verdict_open
}
──────
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;## 3. Formally Verifying Invariants with TLA+&lt;/p&gt;

&lt;p&gt;To ensure that no edge-case or race condition can trigger an un-admitted execution, all allowable state transitions are formally&lt;br&gt;
  specified in TLA+.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(* Invariant: HOLD state produces no execution *)
Inv_HoldNoConsequence ==
    \A c \in Candidates :
        candidateState[c].status = "HOLD" =&amp;gt; ~candidateState[c].executed

(* Invariant: W_pre must exist prior to execution *)
Inv_WPreBeforeExecution ==
    \A c \in Candidates :
        candidateState[c].executed =&amp;gt; candidateState[c].w_pre

(* Invariant: Terminal KILL prevents execution *)
Inv_TerminalKill ==
    \A c \in Candidates :
        candidateState[c].status = "KILL" =&amp;gt; ~candidateState[c].executed
──────
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;## 4. Cryptographic Witness Binding (&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W
 pre
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&amp;amp;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W
 post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;Admitted shadow executions generate an immutable post-execution witness (&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W
 post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;) that cryptographically binds:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;candidate_id (UUID v4)&lt;/li&gt;
&lt;li&gt;w_pre_hash (SHA-256 hash of pre-state)&lt;/li&gt;
&lt;li&gt;policy_hash (SHA-256 hash of Rego policy version)&lt;/li&gt;
&lt;li&gt;input_hash &amp;amp; output_hash&lt;/li&gt;
&lt;li&gt;verdict ("OPEN")&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This creates an unbroken attestation ledger that can be independently audited without relying on trust assumptions.&lt;br&gt;
  ──────&lt;br&gt;
  ## 5. Summary &amp;amp; Claim Boundary&lt;/p&gt;

&lt;p&gt;The AGY Witnessed Admission Fabric guarantees deterministic, policy-governed admission within a Read-Only OT shadow environment.&lt;br&gt;
  It strictly excludes physical actuation, financial transactions, or unmonitored autonomous execution (authority == "NONE").&lt;/p&gt;

&lt;p&gt;By pairing Open Policy Agent (OPA) for policy decoupling, TLA+ for formal state machine safety, and Sigstore/in-toto patterns&lt;br&gt;
  for witness attestation, we establish a robust pattern for safe AI agent orchestration.&lt;br&gt;
  ──────&lt;br&gt;
  What architecture patterns do you use for agentic admission control? Let's discuss in the comments below!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>security</category>
      <category>formalverification</category>
    </item>
  </channel>
</rss>
