<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tony W on Medium]]></title>
        <description><![CDATA[Stories by Tony W on Medium]]></description>
        <link>https://medium.com/@rcholic?source=rss-d85e93a140b0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ABkz-DlOHKnNUR-VG4dU0A.png</url>
            <title>Stories by Tony W on Medium</title>
            <link>https://medium.com/@rcholic?source=rss-d85e93a140b0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:45:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rcholic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stop Giving AI Agents Ambient OS Permissions: The Case for Runtime Trust Infrastructure]]></title>
            <link>https://medium.com/@rcholic/stop-giving-ai-agents-ambient-os-permissions-the-case-for-runtime-trust-infrastructure-9583d7821f70?source=rss-d85e93a140b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9583d7821f70</guid>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[verification]]></category>
            <dc:creator><![CDATA[Tony W]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 18:47:04 GMT</pubDate>
            <atom:updated>2026-03-07T18:47:04.304Z</atom:updated>
            <content:encoded><![CDATA[<p>The explosive rise of autonomous agent frameworks like CrewAI, LangChain, and OpenClaw has been intoxicating for developers. The promise is incredible: hand an LLM a goal, equip it with tools (filesystem access, web browsers, API clients), and watch it autonomously plan, reason, and execute complex workflows.</p><p>But as teams move from weekend science projects to enterprise production, they are hitting a terrifying architectural wall. <strong>Current AI agent frameworks are inherently insecure by design.</strong></p><p>The industry standard right now is to give an AI agent ambient operating system permissions and then cross your fingers. We trust that a probabilistic model, operating on potentially malicious user input (prompt injection), won’t hallucinate a destructive command or exfiltrate sensitive data.</p><p>This approach does not survive contact with an enterprise Chief Information Security Officer (CISO).</p><h3>The Fallacy of Passive AI Governance</h3><p>The market is currently being flooded with “AI Governance” tools. These products attempt to secure agents by scanning prompts for PII, monitoring model “alignment,” or — most absurdly — by having a second LLM act as a “judge” to verify the first LLM’s work.</p><p>This is bureaucracy masquerading as security.</p><p>If your primary defense against an agent wiping a production table is asking another probabilistic model “did that look okay?”, you have already lost. Furthermore, recent proposals suggesting “intent-based security” — where the agent’s generated “plan” is cryptographically signed before execution — are equally flawed. If an agent is successfully prompt-injected, its <strong>intent has been successfully hijacked</strong>. A signed malicious intent is still malicious.</p><p>Security must move from the <strong>planning layer</strong> (the prompt) to the <strong>execution layer</strong> (the system call). We need <strong>Runtime Trust Infrastructure for Agentic Systems</strong>.</p><h3>Enter Predicate Systems: Hard Isolation for LLM Actions</h3><p>Predicate Systems is not a governance dashboard. We build a zero-trust execution sandbox that wraps any AI agent framework (predicate-secure) for both Python &amp; TypeScript. Our architecture physically isolates the agent execution loop into two strict, deterministic checkpoints.</p><p>We operate on a simple philosophy: <strong>Let the agent YOLO its reasoning; just don’t let it YOLO your file system.</strong></p><p>Here is how Runtime Trust Infrastructure works.</p><h3>Phase 1: Pre-Execution Authorization (The Gate)</h3><p>A serious agentic workflow rarely needs raw, unrestricted OS permissions. An analyst agent needs to write to a specific /data/reports/ directory; it does not need read access to /etc/passwd or the SSH keys in ~/.ssh/.</p><p>We provide decentralized, granular IAM (Identity and Access Management) for AI agents without requiring developers to rewrite their tools.</p><h4>1. Decoupled Policies</h4><p>Developers define a declarative YAML policy that dictates exactly what resources a specific agent can touch.</p><p><strong>Example: Declarative YAML policy with granular </strong><strong>fs.* and </strong><strong>browser.* rules</strong></p><pre>version: &quot;1.0&quot;<br>metadata:<br>  scenario: &quot;market-research-agent&quot;<br>  author: &quot;security-team&quot;<br>  compliance: [&quot;SOC2&quot;, &quot;GDPR&quot;]<br>  default_posture: &quot;deny&quot;   # Fail-closed: block anything not explicitly allowed<br>rules:<br>  # ============================================================================<br>  # FILESYSTEM RULES<br>  # ============================================================================<br>  # DENY: Block reads to sensitive system files (evaluated first)<br>  - name: deny-sensitive-fs-read<br>    effect: deny<br>    actions: [&quot;fs.read&quot;, &quot;fs.list&quot;]<br>    resources:<br>      - &quot;/etc/passwd&quot;<br>      - &quot;/etc/shadow&quot;<br>      - &quot;/etc/sudoers&quot;<br>      - &quot;~/.ssh/*&quot;<br>      - &quot;~/.aws/*&quot;<br>      - &quot;**/.env&quot;<br>      - &quot;**/credentials.json&quot;<br>  # DENY: Block all filesystem writes outside workspace<br>  - name: deny-fs-write-outside-workspace<br>    effect: deny<br>    actions: [&quot;fs.write&quot;, &quot;fs.delete&quot;]<br>    resources:<br>      - &quot;/**&quot;                           # Block everything by default<br>  # ALLOW: Read from project workspace<br>  - name: allow-workspace-read<br>    effect: allow<br>    actions: [&quot;fs.read&quot;, &quot;fs.list&quot;]<br>    resources:<br>      - &quot;/workspace/data/**&quot;<br>      - &quot;/workspace/config/*.yaml&quot;<br>  # ALLOW: Write only to reports directory<br>  - name: allow-reports-write<br>    effect: allow<br>    actions: [&quot;fs.write&quot;]<br>    resources:<br>      - &quot;/workspace/data/reports/*.csv&quot;<br>      - &quot;/workspace/data/reports/*.json&quot;<br>  # ============================================================================<br>  # BROWSER RULES<br>  # ============================================================================<br>  # DENY: Block navigation to internal/admin URLs<br>  - name: deny-internal-urls<br>    effect: deny<br>    actions: [&quot;browser.navigate&quot;]<br>    resources:<br>      - &quot;https://*.internal.company.com/*&quot;<br>      - &quot;https://admin.*&quot;<br>      - &quot;http://localhost:*&quot;<br>      - &quot;http://127.0.0.1:*&quot;<br>  # DENY: Block form submissions to untrusted domains<br>  - name: deny-untrusted-form-submit<br>    effect: deny<br>    actions: [&quot;browser.submit&quot;]<br>    resources:<br>      - &quot;https://*&quot;                     # Default block<br>    exceptions:<br>      - &quot;https://api.trusted-vendor.com/*&quot;<br>  # ALLOW: Navigate to approved research domains<br>  - name: allow-research-navigation<br>    effect: allow<br>    actions: [&quot;browser.navigate&quot;, &quot;browser.click&quot;, &quot;browser.scroll&quot;]<br>    resources:<br>      - &quot;https://news.ycombinator.com/*&quot;<br>      - &quot;https://www.reuters.com/*&quot;<br>      - &quot;https://finance.yahoo.com/*&quot;<br>      - &quot;https://www.google.com/search*&quot;<br>  # ALLOW: Extract text from any allowed page<br>  - name: allow-browser-extract<br>    effect: allow<br>    actions: [&quot;browser.extract_text&quot;, &quot;browser.screenshot&quot;]<br>    resources:<br>      - &quot;https://*&quot;                     # Can extract from any page we navigated to</pre><h4>2. The 2ms Rust Bouncer</h4><p>We utilize a local Rust <a href="https://github.com/PredicateSystems/predicate-authority-sidecar">sidecar</a> (predicate-authorityd). When the agent attempts a tool call (e.g., fs.write(&#39;/etc/passwd&#39;, ...)), the predicate-secure SDK intercepts the intent <em>before</em> it reaches the OS. It sends the action and resource to the sidecar, which evaluates it against the policy in under two milliseconds.</p><p>If the action violates the policy, the sidecar returns a hard explicit_deny, and the host OS is never touched.</p><h3>Phase 2: Post-Execution Deterministic Verification (The Proof)</h3><p>The second critical flaw in current architectures is state verification. If an agent clicks “checkout” in a browser, how does the system know it succeeded? Typically, the framework asks the LLM to look at the HTML and guess. This is slow, token-expensive, and prone to hallucination.</p><p>Predicate moves verification from probabilistic guessing to deterministic proof.</p><h4>1. The Token Efficiency of predicate-runtime</h4><p>We built the predicate-runtime skill to handle web perception. It routes the headless browser through a Chrome extension + remote gateway with ML-reranking that aggressively compresses the DOM state. In our demos, extracting data from a dynamic site like Hacker News used only 1206 prompt tokens per reasoning step, compared to thousands for raw HTML.</p><p><strong>Predicate Studio: DOM state diff view showing BEFORE and AFTER an agent action</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iaGoK87yU978cj3z.png" /></figure><h4>2. Mathematical Assertions</h4><p>Instead of “LLM-as-judge,” we use deterministic code-based assertions defined in the YAML policy.</p><ul><li>Does the URL now contain /checkout/success? (url_contains)</li><li>Does the confirmation button now exist in the DOM? (element_exists)</li><li>Does the local file now exist and contain data? (fs.exists)</li></ul><p>These assertions provide mathematical certainty that the agent successfully completed the task, closing the loop with complete trust.</p><h3>Conclusion: The New Infrastructure Standard</h3><p>As the agent economy grows, the definition of an “agent” will shift from a raw LLM to a complex system containing an LLM, a sandbox, a policy engine, and a verifier.</p><p>LangChain and CrewAI are the brains. <strong>Predicate is the nervous system and the immune system.</strong></p><p>If you are tired of building toys and are ready to deploy robust, SOC2-compliant, autonomous workflows to production, it is time to deploy Runtime Trust Infrastructure.</p><p>Check out our <a href="https://predicatesystems.ai/docs"><strong>docs</strong></a> and the <a href="https://github.com/PredicateSystems/predicate-secure"><strong>predicate-secure</strong></a> SDK on GitHub to get started.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9583d7821f70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From brittle browser bots to deterministic agents]]></title>
            <link>https://medium.com/@rcholic/from-brittle-browser-bots-to-deterministic-agents-42046c22d582?source=rss-d85e93a140b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/42046c22d582</guid>
            <category><![CDATA[assertions]]></category>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[browser-automation]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[deterministic-ai]]></category>
            <dc:creator><![CDATA[Tony W]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 01:33:01 GMT</pubDate>
            <atom:updated>2026-01-21T01:33:01.294Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Why structure-first snapshots + Jest-style assertions change everything</strong></p><p>The first time I watched an “AI agent” shop on Amazon, it wasn’t inspiring. It was expensive, slow, and weirdly confident.</p><p>I call it <strong>the $2 Amazon click</strong>.</p><p>It happened on a simple step: click “Proceed to checkout” and verify the redirect. The vision agent saw a bright button, clicked roughly the right pixels, and then… nothing. The page didn’t end up where it should. The agent didn’t notice. It just kept narrating progress while burning tokens. After a few loops, I had spent a few dollars in API credits and got exactly zero confidence that the system could be trusted to run unattended.</p><p>The frustrating part wasn’t the failure. It was the <em>silence</em> — no crisp definition of “success,” no hard “this step failed,” no evidence beyond screenshots.</p><h3>The aha: pixels are the problem, the DOM is the solution</h3><p>Here’s what finally clicked for me: <strong>pixels are a terrible control plane</strong> for automation.</p><p>Screenshots are rich, but they’re also ambiguous. A pixel model can “see” a button and still have no idea whether the button is <em>clickable</em> or the click <em>actually</em> navigated, whether a drawer appeared, or whether a text field contains the value it thinks it typed. Without a feedback loop, you don’t have an agent. You have a narrator.</p><p>So I flipped the paradigm:</p><ul><li>Don’t ask a model to infer state from pixels.</li><li>Give the model a structured view of the page.</li><li>And most importantly: <strong>verify every step like a test.</strong></li></ul><p>That’s the mental model behind SentienceAPI: <strong>Jest for Agents</strong>.</p><p>Not as a marketing tagline — as an engineering stance. In Jest, you don’t “hope” your code works. You assert what must be true. If it’s not true, the test fails with evidence. That’s what I wanted for browser agents.</p><h3>What “Jest for Agents” looks like in practice</h3><p>SentienceAPI introduces a verification layer: explicit assertions over a semantic snapshot of the page. Instead of “the model thinks it worked,” you check state transitions:</p><ul><li>url_contains(&quot;/dp/&quot;) to confirm you actually reached a product page</li><li>exists(&quot;text~&#39;No thanks&#39;&quot;) to detect an upsell drawer</li><li>any_of(url_contains(&quot;signin&quot;), url_contains(&quot;/ap/&quot;), url_contains(&quot;checkout&quot;)) to confirm checkout redirect</li></ul><p>The key detail: <strong>verification is inline runtime gating</strong>, not post-hoc analysis. A step doesn’t “pass” until the assertion passes. If a required assertion fails, the runtime can retry (bounded) or re-plan, and it captures artifacts.</p><p>Here’s the smallest useful pattern:</p><pre>ok = await runtime.check(<br>    exists(&quot;role=textbox&quot;),<br>    label=&quot;search_box_visible&quot;,<br>    required=True,<br>).eventually(timeout_s=10.0, poll_s=0.25, max_snapshot_attempts=3)</pre><p>You can think of that as: “keep taking snapshots until the world matches the expectation, or fail.”</p><h3>“Semantic geometry”: X‑ray specs, not screenshots</h3><p>If “DOM” sounds too raw — like handing HTML text to a model — this is where semantic geometry matters.</p><p>A semantic snapshot is closer to giving the model <strong>X‑ray specs</strong>:</p><ul><li>roles (“button”, “searchbox”, “link”)</li><li>visible text</li><li>geometry (bounding boxes)</li><li>a compact “importance” signal</li></ul><p>It’s not a screenshot, and it’s not raw HTML. It’s the minimal structure needed to act and verify. The model isn’t decoding pixels; it’s navigating a labeled map.</p><p>Once you do that, you can reduce the problem dramatically: filter elements per step (e.g., “only search inputs” or “only buttons”), and you reduce tokens because the model is no longer reading the entire page.</p><p>In one cloud baseline run, element filtering reduced prompt size from an estimated ~35k tokens to 19,956 (~43% reduction). The model didn’t get smarter. The <em>interface</em> did.</p><h3>The climax: the day the local stack worked</h3><p>After a few iterations, I ran the flow fully autonomously with a local planner/executor stack:</p><ul><li><strong>Planner</strong>: DeepSeek‑R1 (reasoning: “what should we do next, and what must be true afterward?”)</li><li><strong>Executor</strong>: Qwen (acting: “CLICK/TYPE which element?”)</li></ul><p>And it worked end-to-end.</p><p>Not in a “demo video” sense — more in a “boring CI run” sense. The run ended with a line that felt almost anticlimactic:</p><blockquote><em>“duration_ms: 405740 … tokens_total: 11114 … Steps passed: 7/7”</em></blockquote><p>The moment felt like magic, because autonomy finally looked stable. But it wasn’t magic. It was deterministic engineering:</p><ul><li>the planner proposed intent and verification,</li><li>the executor chose concrete actions from a constrained snapshot,</li><li>the runtime enforced assertions and applied deterministic overrides when intent was unambiguous (e.g., dismissing an upsell drawer reliably).</li></ul><p>Here’s what that looks like when the UI tries to derail you:</p><pre>[fallback] drawer_no_thanks preselect -&gt; CLICK(7438)<br>Executor decision: {&quot;action&quot;: &quot;click&quot;, &quot;id&quot;: 7436, &quot;raw&quot;: &quot;CLICK(7436)&quot;}<br>[override] drawer_no_thanks -&gt; CLICK(7438)</pre><p>That’s not “LLM intuition.” That’s a system saying: “I know which branch is correct; take it.”</p><h3>Why small local models start winning</h3><p>This is the part that surprised me the most.</p><p>When people talk about agents, they usually assume reliability comes from a bigger model. In practice, reliability comes from <strong>a verifiable loop</strong>. Once you have assertions, you don’t need a model that’s always right. You need a model that’s <em>right often enough</em> inside a system that can detect and correct errors.</p><p>That’s the punchline:</p><ul><li>A strong model without verification can fail silently and keep going.</li><li>A modest model with strict verification fails loudly and recovers.</li></ul><p>In other words: <strong>verification beats intelligence on reliability</strong>.</p><h3>Copy the “Amazon recipe” locally</h3><p>If you want to try this approach on your own machine, start with the simplest path. For the full engineering write-up (metrics, logs, and architecture), see <a href="https://www.sentienceapi.com/blog/verification-layer-amazon-case-study">“A verification layer for browser agents: Amazon case study”</a>.</p><ol><li>Install the SDK and browser runtime:</li></ol><pre>pip install sentienceapi<br>playwright install chromium</pre><ol><li>If you want to run local models:</li></ol><pre>pip install transformers torch</pre><ol><li>Implement your agent loop as three responsibilities:</li></ol><ul><li><strong>Planner</strong>: outputs JSON steps with explicit verifications.</li><li><strong>Executor</strong>: chooses CLICK/TYPE actions from structured snapshots.</li><li><strong>Runtime</strong>: runs snapshot() → act → assert/check → retry/replan and records traces/artifacts.</li></ul><p>If you already have a brittle bot that “mostly works,” don’t start by swapping models. Start by adding verification gates. Once the loop is deterministic and tight, you can often downgrade the model — and finally get the economics and privacy of local execution without giving up reliability.</p><p>Below is a screenshot of the Amazon shopping case study in Sentience Studio with time-travel debugging, per-step verification (deterministic PASS or FAIL), etc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZ0bAYgM4uQ5Q1suU1BXoQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42046c22d582" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Clicking: How We Taught AI Web Agents to Understand “First,” “Main,” and “Done”]]></title>
            <link>https://medium.com/@rcholic/beyond-clicking-how-we-taught-ai-web-agents-to-understand-first-main-and-done-642d0297f24d?source=rss-d85e93a140b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/642d0297f24d</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[browser-automation]]></category>
            <category><![CDATA[ai-infrastructure]]></category>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[web-automation]]></category>
            <dc:creator><![CDATA[Tony W]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 06:15:46 GMT</pubDate>
            <atom:updated>2026-01-12T06:15:46.141Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why reliable AI web automation needs geometry, ordinality, and verification — not just screenshots</em></p><p>When we first released <strong>SentienceAPI</strong>, our goal was simple: give AI agents a scalable perception layer to understand web pages <em>without</em> relying entirely on brittle DOM selectors or expensive vision-only prompts.</p><p>Instead of parsing massive HTML trees or feeding screenshots to large models, we introduced <strong>semantic geometry</strong> — a compact, structured description of what’s on a page:</p><ul><li>what’s interactive</li><li>what’s visually important</li><li>where elements are relative to each other</li></ul><p>This approach worked well for many tasks.</p><p>But it immediately surfaced a harder problem:</p><blockquote><strong><em>“Can the agent reliably find the </em>first<em> result?”</em></strong></blockquote><p>That one word — <em>first</em> — turned out to expose a fundamental weakness in most AI web agents.</p><h3>Why “First” Is Hard for AI Agents</h3><p>Take this task:</p><blockquote>Find the #1 Show HN post on Hacker News.</blockquote><p>Humans solve this instantly by visually scanning the page. For AI agents, it’s surprisingly tricky.</p><p>Why?</p><ul><li><strong>HTML doesn’t encode visual order.</strong> CSS can reorder content arbitrarily. DOM order ≠ what users see.</li><li><strong>Vision-only approaches are expensive and ambiguous.</strong> Models must infer layout, grouping, and meaning all at once.</li><li><strong>Accessibility trees lose hierarchy.</strong> They capture roles, but not spatial dominance or list structure.</li></ul><p>As a result, many agents can find <em>a</em> relevant item — but not <em>the top one</em>.</p><p>So we taught SentienceAPI something new.</p><h3>Dominant Groups: Teaching Agents What the “Main List” Is</h3><p>Most real web pages share a pattern:</p><ul><li>navigation and controls</li><li>headers and footers</li><li><strong>one dominant repeated structure</strong> (search results, feeds, tables)</li></ul><p>Humans recognize this instantly. Machines don’t — unless you encode it.</p><h3>The key idea</h3><p>On most pages, the primary content:</p><ul><li>repeats with similar geometry</li><li>aligns consistently</li><li>occupies the majority of visible space</li></ul><p>Sentience now detects this automatically and labels it the <strong>dominant group</strong>.</p><p>Within that group, elements are ordered visually — top to bottom.</p><p>Once you have:</p><ul><li>dominant group membership</li><li>visual order within that group</li></ul><p>ordinal concepts like <strong>“first,” “top 3,” or “main result”</strong> become explicit signals instead of vague language.</p><p>This works across:</p><ul><li>news feeds</li><li>search results</li><li>product listings</li><li>dashboards</li></ul><p>No site-specific logic. No selectors. Just geometry and structure.</p><h3>Realistic Token Economics (No Hype)</h3><p>Let’s talk honestly about cost.</p><p>A typical <strong>Sentience snapshot prompt</strong> today is about <strong>700–1,200 tokens per step</strong>, depending on page complexity.</p><p>That’s <strong>not magically free</strong>, and it’s not orders of magnitude cheaper than every alternative but at a fraction of the cost of cloud vision LLM.</p><p>However, it <em>is</em> meaningfully different in three important ways:</p><h3>1. Bounded and predictable</h3><ul><li>Token usage scales with <strong>number of semantic elements</strong>, not DOM size.</li><li>You don’t suddenly jump from 800 tokens to 5,000 because a page layout changed.</li><li>This makes budgeting and optimization tractable.</li></ul><h3>2. Vision-optional, not vision-dependent</h3><ul><li>Many tasks work <strong>without screenshots at all</strong>.</li><li>Vision models are still available as a fallback — not a default.</li><li>This avoids paying vision costs on every step “just in case.”</li></ul><h3>3. Works with smaller and local models</h3><p>We’ve successfully run browser agents using:</p><ul><li><strong>Qwen 2.5 3B</strong></li><li>fully local</li><li>no vision</li><li>no cloud APIs</li></ul><p>While a local model may still consume tokens internally, the <em>input</em> stays compact and structured — which dramatically improves stability and reproducibility.</p><p>So the real benefit isn’t “50× cheaper.”</p><p>It’s that <strong>cost becomes controlled, explainable, and optional</strong>, rather than unpredictable and mandatory.</p><h3>Browser-Use Integration: Practical, Not Theoretical</h3><p>To make this usable in real workflows, we integrated Sentience directly with <strong>browser-use</strong>, a popular open-source agent framework.</p><p>The split is clean:</p><ul><li>browser-use handles execution and planning</li><li>Sentience provides page understanding</li><li>the LLM reasons over structured meaning, not raw pixels</li></ul><p>This lets developers:</p><ul><li>run agents locally by default</li><li>selectively enable cloud models</li><li>debug behavior step by step</li></ul><p>It turns web agents from a demo into something you can actually iterate on.</p><h3>Verification: Knowing the Task Is Actually Done</h3><p>Another gap in most AI agents is verification.</p><p>Agents usually say:</p><blockquote><em>“The task is complete.”</em></blockquote><p>That’s <strong><em>not</em></strong> enough for:</p><ul><li>QA</li><li>CI pipelines</li><li>automation you rely on</li><li>debugging failures</li></ul><p>Sentience introduces <strong>explicit assertions</strong> over semantic state.</p><p>Instead of trusting the model, you assert facts like:</p><ul><li>“The dominant list exists”</li><li>“The first item matches my goal”</li><li>“Navigation reached the expected domain”</li><li>“The web page contains your expected keywords”</li></ul><p>These checks:</p><ul><li>are deterministic</li><li>run every step and the end of the entire task</li><li>produce concrete failure reasons</li><li>can be <em>replayed</em> later</li><li>can be visualized and replayed in Sentience Studio</li></ul><p>This shifts agents from “best effort” to <strong>verifiable systems</strong>.</p><p><strong>A preview of Sentience Studio:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzHk2V5JIDCt_1AZ7Uqpsw.png" /></figure><h3>A Different Mental Model for Web Agents</h3><p>Taken together, these changes suggest a new way to think about AI web automation:</p><ul><li>Not DOM hacking</li><li>Not screenshot guessing</li><li>Not blind trust in completions</li></ul><p>But instead:</p><ul><li><strong>semantic grounding</strong></li><li><strong>ordinal reasoning</strong></li><li><strong>bounded cost</strong></li><li><strong>explicit verification</strong></li></ul><p>SentienceAPI doesn’t replace LLMs. It gives them a structured, stable interface to the web.</p><h3>What’s Next</h3><p>We’re continuing to improve:</p><ul><li>ordinal reasoning (“last”, “top N”, “List + constraint, e.g. first product with rating ≥ 4”)</li><li>snapshot results reranking</li><li>group detection across complex layouts</li><li>assert with snapshot diffing (e.g. what UI element state changed)</li><li>local-first agent workflows including smaller models like Bitnet-b1.58–2B-4T on edge devices</li><li>Build integration support for HyperBrowser</li></ul><p>The goal isn’t to make agents smarter in theory — it’s to make them <strong>reliable in practice</strong>.</p><p>If you’ve ever watched a web agent confidently do the wrong thing, this work is for you.</p><p><strong>Working Integrations (in GitHub) with Browser-use</strong></p><ol><li><a href="https://github.com/SentienceAPI/browser-use/pull/5">Machine-verifiable assertions to SentienceAgent in browser-use</a> with per-step and task completion verification through Sentience SDK</li><li><a href="https://github.com/SentienceAPI/browser-use/pull/4">Use Local LLM QWen2.5 3B model in browser-use web agent</a></li><li><a href="https://github.com/SentienceAPI/browser-use/pull/1">Sentience SDK Saves more than 50% Token Usage Cost in browser-use agents</a></li></ol><p><strong>Open-Source SDKs</strong></p><p>Sentience SDK is fully open source, under MIT and Apache 2.0 dual licenses:</p><ul><li><strong>Python SDK:</strong> <a href="https://github.com/SentienceAPI/sentience-python">https://github.com/SentienceAPI/sentience-python</a></li><li><strong>TypeScript SDK:</strong> <a href="https://github.com/SentienceAPI/sentience-ts">https://github.com/SentienceAPI/sentience-ts</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=642d0297f24d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Web Agents Fail — and How Semantic Geometry Helps Them Execute]]></title>
            <link>https://medium.com/@rcholic/why-web-agents-fail-and-how-semantic-geometry-helps-them-execute-24d5a6cb950d?source=rss-d85e93a140b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/24d5a6cb950d</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Tony W]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 04:56:07 GMT</pubDate>
            <atom:updated>2025-12-23T04:56:07.226Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Web Agents Fail — and How Semantic Geometry Helps Them Execute</h3><p>Over the last year, I watched many teams try to build “AI agents” that can really use the web.</p><p>Planning is not the hard part anymore.</p><p>Execution is.</p><p>LLMs can describe steps very well:</p><blockquote>“Search → open a result → click Add to Cart”</blockquote><p>But once you ask the model to <strong>act</strong> on a real site, things break fast:</p><ul><li>clicks miss the target</li><li>buttons are covered by banners</li><li>vision models guess wrong coordinates</li><li>retries pile up</li><li>costs become unpredictable</li></ul><p>This post explains <strong>why this happens</strong>, and what I’m building to reduce these failures: <strong>SentienceAPI</strong>, a semantic geometry layer that gives agents a <em>grounded action space</em>.</p><h3>Demo: MotionDocs “Add to Cart” (Real Website)</h3><p>I built a reference app called <strong>MotionDocs</strong> on top of SentienceAPI.</p><p>It observes real pages, lets an LLM choose actions using grounded geometry, then executes those actions and renders everything into a tutorial-style video.</p><p><strong>Demo video (Amazon Add to Cart):</strong> <a href="https://youtu.be/1DlIeHvhOg4">https://youtu.be/1DlIeHvhOg4</a></p><h3>How the Agent Sees the Page (Reduced Action Space)</h3><p>Below is a wireframe view from SentienceAPI <strong>Map mode</strong>.</p><p>Each box is a <strong>visible, interactable element</strong> (not raw HTML, not pixels), with geometry + lightweight visual cues (like is_primary).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*FyM35tc5ymAxEOfbXoQ7KA.png" /></figure><p>This is the key idea: the agent doesn’t reason over the whole DOM or the whole screenshot. It reasons over a <strong>small action space</strong>.</p><h3>Small Code Excerpt</h3><p>I’m sharing a small snippet to show the <em>surface area</em> is simple, even though the machinery underneath is not.</p><pre>from sentience_sdk import SentienceApiClient<br>from motiondocs import generate_video<br><br>video = generate_video(<br>    url=&quot;https://www.amazon.com/gp/bestsellers/&quot;,<br>    instructions=&quot;Open a product and add it to cart&quot;,<br>    sentience_client=SentienceApiClient(api_key=&quot;your-api-key-here&quot;)<br>)<br><br>video.save(&quot;demo.mp4&quot;)</pre><h3>Why Web Agents Fail Today</h3><h3>1) DOM automation breaks on modern pages</h3><p>Classic automation does:</p><ul><li>scrape HTML</li><li>query CSS selectors</li><li>click/type</li></ul><p>But modern pages are hostile:</p><ul><li>overlays and z-index layers</li><li>dynamic layout shifts</li><li>iframes / shadow DOM</li><li>“present in DOM” ≠ “clickable by user”</li></ul><p>The DOM says a button exists. The user can’t click it. The agent clicks anyway — and fails.</p><h3>2) Vision-first agents are flexible, but unreliable for execution</h3><p>Vision-first agents do:</p><ul><li>take screenshot</li><li>send to multimodal LLM</li><li>ask “where should I click?”</li></ul><p>This feels human-like, but causes new problems:</p><ul><li>coordinates are <em>guessed</em>, not guaranteed</li><li>outputs vary across runs</li><li>retries are common</li><li>total cost becomes hard to predict</li></ul><p>A single vision call can be cheap. A <em>successful workflow</em> often isn’t.</p><h3>The Core Missing Layer: A Grounded Action Space</h3><p>Humans don’t see the web as raw HTML or pixels. We see:</p><ul><li>what’s visible</li><li>what’s clickable</li><li>what stands out</li><li>what’s blocked</li></ul><p>Most agents don’t get this representation.</p><p>They either get:</p><ul><li>too much noise (HTML), or</li><li>too little structure (screenshots)</li></ul><h3>My Approach: Semantic Geometry Grounding + Visual Cues</h3><p>SentienceAPI reduces a page into a <strong>grounded action space</strong> made of elements that are:</p><ul><li>visible</li><li>interactable</li><li>located precisely in the viewport</li></ul><p>Each element includes:</p><ul><li>geometry (x, y, width, height)</li><li>visibility + occlusion status</li><li>semantic role (button, input, link…)</li><li>lightweight visual cues</li></ul><p>This is not “guessing from pixels.” It’s computed.</p><h3>The Key Insight: Visual Cues (especially is_primary)</h3><p>Humans rely on visual hierarchy.</p><p>A “Buy Now” button is not the same as a footer link, even if both are clickable.</p><p>So SentienceAPI adds a few low-cost cues, for example:</p><ul><li><strong>occlusion awareness</strong> (is it covered?)</li><li><strong>affordance</strong> (cursor pointer/text, role)</li><li><strong>prominence / importance</strong></li><li><strong>is_primary</strong>: “is this a primary action on this screen?”</li></ul><p>Example (simplified):</p><pre>{<br>  &quot;id&quot;: 42,<br>  &quot;role&quot;: &quot;button&quot;,<br>  &quot;text&quot;: &quot;Add to Cart&quot;,<br>  &quot;bbox&quot;: { &quot;x&quot;: 935, &quot;y&quot;: 529, &quot;w&quot;: 200, &quot;h&quot;: 50 },<br>  &quot;visual_cues&quot;: {<br>    &quot;cursor&quot;: &quot;pointer&quot;,<br>    &quot;is_primary&quot;: true<br>  }<br>}</pre><h3>Evidence: Two Small Comparisons (Amazon + Google)</h3><p>I’m still early, so these are not “big academic benchmarks”. But they were useful for me to learn what actually works in practice.</p><h3>1) Amazon shopping flow (search → select → add to cart)</h3><p><strong>Setup A (semantic geometry)</strong>: Sentience SDK + structured action space + LLM</p><p><strong>Setup B (vision-first)</strong>: screenshots + GPT-4o vision + browser automation</p><p><strong>Result (my runs):</strong></p><ul><li>Semantic geometry approach: <strong>3/3 completed</strong></li><li>Vision approach: <strong>0/3 completed</strong> (failed to reliably type, navigate, or recover)</li></ul><p>Why this mattered to me: with semantic geometry, I can aggressively filter the action space per scene (ex: only keep inputs, or only keep product links), which reduced LLM token usage and helped the agent make decisions more stable.</p><h3>2) Google search flow (search → click non-ad result)</h3><p><strong>Task:</strong> search “visiting japan” and click a non-ad result.</p><p><strong>Result (my runs):</strong></p><ul><li>Semantic geometry: <strong>2/2 success</strong>, and after filtering I used <strong>~2,636 tokens</strong> for the whole task</li><li>Vision-based: <strong>0/2 success</strong> (empty responses / inconsistent behavior)</li></ul><p>Again, small sample size. But it showed a pattern: when the agent gets roles like combobox / link, plus a compact candidate list, it becomes much easier to control and optimize.</p><p><strong>Important note:</strong> vision models are amazing at many things (OCR, charts, UI understanding). I’m not saying “vision is useless.” I’m saying <strong>vision-only is fragile for precise browser execution</strong> unless you build lots of extra scaffolding.</p><h3>Determinism vs Guessing</h3><p>This is the big difference for execution:</p><p>Vision-based clicking:</p><ul><li>infer coordinates probabilistically</li><li>may vary across runs</li><li>often needs retries</li></ul><p>Semantic geometry:</p><ul><li>deterministic coordinates</li><li>reproducible</li><li>easier to debug</li></ul><p>LLMs decide <em>what</em> to do. Semantic geometry makes those actions <strong>executable</strong>.</p><h3>“But Vision Calls Are Cheaper”</h3><p>Maybe per call, yes.</p><p>But in real workflows:</p><ul><li>failures trigger retries</li><li>debugging is harder</li><li>total cost is “hidden” in loops</li></ul><p>My goal is not the cheapest screenshot call. My goal is the cheapest <strong>successful action</strong>.</p><h3>MotionDocs is a Demo. SentienceAPI is the Product.</h3><p>MotionDocs is a reference app.</p><p>SentienceAPI is the underlying layer:</p><ul><li><strong>Map</strong>: interactable elements + geometry + cues</li><li><strong>Visual</strong>: geometry aligned with screenshot for verification</li><li><strong>Read</strong>: clean text/markdown extraction for context/RAG</li></ul><h3>Who This Is For</h3><p>Not for:</p><ul><li>ultra-cheap scraping</li><li>massive crawling</li><li>“just give me markdown” use cases</li></ul><p>For:</p><ul><li>agent builders who need reliability</li><li>teams shipping real workflows</li><li>people tired of flaky selector automation</li><li>infra teams who care about predictable execution + cost</li></ul><h3>Reproducibility</h3><p>Both demos (Amazon shopping and Google search) are reproducible.</p><p>The full demo code, prompts, and SDK usage are documented here: <a href="https://github.com/SentienceAPI/sentience-sdk-playground">https://github.com/SentienceAPI/sentience-sdk-playground</a></p><p>This repo contains raw results, screenshots &amp; videos:</p><ul><li>the Amazon shopping demo</li><li>the Google search demo</li><li>side-by-side SDK vs vision experiments</li><li>token usage instrumentation</li></ul><h3>Closing</h3><p>Most agent failures are not reasoning failures. They are <strong>perception + execution</strong> failures.</p><p>My belief is simple:</p><blockquote><em>Give the model a better action space, and it will behave better.</em></blockquote><p>This is early work, not launched yet. I’m sharing to learn and get feedback.</p><p>If you’re building agents, automation, QA, or developer tools, I’d love to hear your thoughts.</p><p>— Tony W, Founder of SentienceAPI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zIck8Q9POxQ4Bs9R.png" /></figure><p><strong><em>A complex website like Amazon can be educed to semantic geometry — action space for AI Agents</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24d5a6cb950d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>