<?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: Patrick Hughes</title>
    <description>The latest articles on DEV Community by Patrick Hughes (@pat9000).</description>
    <link>https://dev.to/pat9000</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3763138%2Fa7736e79-1b96-4f55-a9f7-9ddd8775eb09.jpg</url>
      <title>DEV Community: Patrick Hughes</title>
      <link>https://dev.to/pat9000</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pat9000"/>
    <language>en</language>
    <item>
      <title>The Age of Accountable Agents: Building Trust in Your AI Automation</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Wed, 20 May 2026 14:45:12 +0000</pubDate>
      <link>https://dev.to/pat9000/the-age-of-accountable-agents-building-trust-in-your-ai-automation-2ac5</link>
      <guid>https://dev.to/pat9000/the-age-of-accountable-agents-building-trust-in-your-ai-automation-2ac5</guid>
      <description>&lt;h1&gt;
  
  
  The Age of Accountable Agents: Building Trust in Your AI Automation\n\nThe air around AI feels different this "Long Hot A.I. Summer." Big tech is pouring billions into development-Elon Musk's legal battles, Meta reassigning 7,000 employees to focus on AI-it's a high-stakes, high-energy environment. But for us, building powerful AI agents on consumer hardware, this moment isn't just about raw computational power or complex models. It's about something more fundamental: trust.\n\nThe recent news cycle offers a stark reminder of the ethical considerations, user control challenges, and privacy implications that come with advanced automation. From a papal encyclical discussing AI's moral implications to significant settlements over hard-to-cancel subscriptions, and even debates around nationwide data collection, the narrative is clear: we're entering the Age of Accountable Agents. And as developers, especially those focused on local, user-centric AI, we have a unique opportunity to lead the charge.\n\n## Trust Through Transparency: The AI Encyclical's Echo\n\nWhen you hear about an Anthropic co-founder discussing AI ethics with the Pope, it's a signal that the impact of our work extends far beyond our terminals. AI agents, by their nature, automate decisions. For these agents to be truly valuable and accepted, they must be transparent.\n\nWhat does transparency mean for an agent running on your hardware? It means:\n\n*   &lt;strong&gt;Clear Decision Paths:&lt;/strong&gt; Can a user understand &lt;em&gt;why&lt;/em&gt; their agent took a particular action? If your agent automatically categorizes emails, can it explain its reasoning?\n*   &lt;strong&gt;Auditable Logic:&lt;/strong&gt; Even if not a full "explanation," the underlying logic should be inspectable. This doesn't mean revealing proprietary secrets, but designing agents where state changes and rule applications are explicit.\n\nConsider an agent designed to manage your smart home devices. Instead of a black box, you could implement a simple logging mechanism:\n\n
&lt;/h1&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;python\nclass SmartHomeAgent:\n    def __init__(self, name):\n        self.name = name\n        self.log = []\n\n    def act_on_temperature(self, current_temp, desired_temp):\n        if current_temp &amp;gt; desired_temp + 2:\n            action = "Turning on AC"\n            self.log_action(action, f"Current: {current_temp}°C, Desired: {desired_temp}°C")\n            # ... actual AC control code\n        elif current_temp &amp;lt; desired_temp - 2:\n            action = "Turning on Heater"\n            self.log_action(action, f"Current: {current_temp}°C, Desired: {desired_temp}°C")\n            # ... actual Heater control code\n        else:\n            action = "No action needed"\n            self.log_action(action, f"Current: {current_temp}°C, Desired: {desired_temp}°C")\n        return action\n\n    def log_action(self, action, details):\n        self.log.append(f"[{self.name}] {datetime.now()}: {action} - {details}")\n\n# Usage\nagent = SmartHomeAgent("ClimateControl")\nagent.act_on_temperature(25, 22)\nprint(agent.log)\n&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
\n\nThis basic logging provides a human-readable trail, fostering trust by showing, not just doing.\n\n## User Autonomy, Not "Hard-to-Cancel": Learning from Shutterstock\n\nThe $35 million settlement Shutterstock faced over difficult subscription cancellations is a potent lesson: users demand control over automated systems. For AI agents, this translates directly to how we design interaction and management. Your agent shouldn't feel like a digital trap.\n\nKey design principles for user autonomy:\n\n*   &lt;strong&gt;Explicit Opt-in/Opt-out:&lt;/strong&gt; Clear consent for agent actions and data usage.\n*   &lt;strong&gt;Easy Pause and Stop:&lt;/strong&gt; Users must be able to halt or reconfigure an agent's operation immediately.\n*   &lt;strong&gt;Understandable Configuration:&lt;/strong&gt; Agent settings should be accessible and intuitive, not buried in obscure files.\n\nThink about how your agent's lifecycle is managed. Here's a conceptual &lt;code&gt;AgentController&lt;/code&gt;:\n\n&lt;br&gt;
&lt;br&gt;
&lt;code&gt;python\n# pseudo-code for an AgentController\nclass AgentController:\n    def __init__(self, agent):\n        self.agent = agent\n        self._running = False\n\n    def start(self):\n        if not self._running:\n            print(f"Starting {self.agent.name}...")\n            self._running = True\n            # thread or process start logic for agent.run()\n            self.agent.start_service()\n\n    def pause(self):\n        if self._running:\n            print(f"Pausing {self.agent.name}...")\n            self._running = False\n            self.agent.pause_service()\n\n    def stop(self):\n        if self._running:\n            print(f"Stopping {self.agent.name} permanently...")\n            self._running = False\n            self.agent.stop_service()\n            # Clean up resources\n\n    def configure(self, new_settings):\n        print(f"Configuring {self.agent.name} with new settings.")\n        self.agent.update_settings(new_settings)\n\n# When you're building your agents, consider how these controls are exposed to the user.\n&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
\n\nFor more effective agent management, especially concerning permissions and operational boundaries on local hardware, check out &lt;a href="https://dev.to/tools/agentguard"&gt;AgentGuard&lt;/a&gt;. It helps you build in these essential controls from the ground up.\n\n## Privacy by Design, Not by Accident: The FBI's Data Ambition\n\nThe FBI's desire for nationwide license plate reader access is a stark reminder of the sheer scale of data collection possible today. For local AI agents, privacy should be a default setting, not an afterthought.\n\nWhen designing your agents, prioritize:\n\n*   &lt;strong&gt;Local-First Processing:&lt;/strong&gt; Perform computations and store data on the user's device whenever possible.\n*   &lt;strong&gt;Data Minimization:&lt;/strong&gt; Only collect and process the data absolutely necessary for the agent's function.\n*   &lt;strong&gt;Transparent Data Policies:&lt;/strong&gt; Clearly communicate what data an agent uses, why, and whether it ever leaves the device.\n\nBuilding agents for consumer hardware gives us a distinct advantage here. We can champion local intelligence and ensure that user data stays private by default, not by policy fine print.\n\n## Architecting for Clarity: The Lisp Connection\n\nThe Lisp family of languages (Common Lisp, Racket, Clojure) are hyperpolyglots for a reason: their power in symbolic computation and metaprogramming encourages clarity in expressing complex logic. While you might not be writing your agent in Emacs Lisp, the principles of clear, inspectable, and modular design are paramount.\n\nAn agent with well-defined modules for perception, decision-making, and action is easier to debug, understand, and, crucially, to trust. Avoid monolithic codebases where an agent's reasoning is opaque.\n\n&lt;br&gt;
&lt;br&gt;
&lt;code&gt;python\n# Conceptual Agent Architecture\nclass AgentBrain:\n    def __init__(self, perception_module, decision_module, action_module):\n        self.perception = perception_module\n        self.decision = decision_module\n        self.action = action_module\n\n    def run_cycle(self, environment_data):\n        perceived_state = self.perception.process(environment_data)\n        desired_action = self.decision.evaluate(perceived_state)\n        self.action.execute(desired_action)\n        return desired_action # For logging/traceability\n\n# Each module can have its own transparent logic, making the overall agent's behavior understandable.\n&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
\n\n## The Intentional Click: Feedback Loops and Refinement\n\nEven a seemingly simple site like &lt;code&gt;clickclickclick.click&lt;/code&gt; can serve as a quirky reminder of direct user interaction. How do your agents &lt;em&gt;confirm&lt;/em&gt; intent? How do they solicit feedback effectively? It's not about mindlessly automating every single interaction, but about designing clear, intentional communication channels between the user and the agent.\n\nConsider points where your agent might ask, "Did I do that correctly?" or "Is this what you intended?" rather than just assuming. This explicit feedback loop refines the agent's understanding and reinforces the user's sense of control.\n\n## Building for a Trustworthy AI Future\n\nThe AI revolution is here, and it's happening everywhere, from the largest data centers to the devices in our pockets. As developers crafting AI agents for consumer hardware, we stand at a critical juncture. We have the unique opportunity-and responsibility-to build agents that are not just intelligent and efficient, but also trustworthy, accountable, and respectful of user autonomy and privacy.\n\nThis summer's "AI gold rush" shouldn't just be about speed; it should be about quality, ethics, and user-centric design. By focusing on transparency, control, and privacy by default, we can ensure our AI agents truly empower, rather than overwhelm, the people who use them.\n\nTo help manage these critical aspects of your agent's lifecycle, from permissions to operational safety, explore &lt;a href="https://dev.to/tools/agentguard"&gt;AgentGuard&lt;/a&gt;. It's designed to support you in building the next generation of conscientious AI automation. Start building agents that earn trust, today.\n&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>automation</category>
      <category>ethics</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Securing Your AI Agents: Essential Practices for On-Device Automation</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Wed, 20 May 2026 14:45:08 +0000</pubDate>
      <link>https://dev.to/pat9000/securing-your-ai-agents-essential-practices-for-on-device-automation-2k8d</link>
      <guid>https://dev.to/pat9000/securing-your-ai-agents-essential-practices-for-on-device-automation-2k8d</guid>
      <description>&lt;h1&gt;
  
  
  Securing Your AI Agents: Essential Practices for On-Device Automation
&lt;/h1&gt;

&lt;p&gt;The "Long Hot A.I. Summer" is upon us, as one New York Times headline aptly put it. With major industry shifts like Meta reassigning 7,000 employees to focus on AI and high-profile legal battles shaping the future of foundational models, the pace of innovation is accelerating. As AI models become more capable, the discussion quickly moves from raw intelligence to practical application: building autonomous AI agents that deliver real value. For those of us building these agents to run efficiently and privately on consumer hardware, recent news serves as a critical reminder of two core tenets: security and efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Imperative of On-Device Security
&lt;/h2&gt;

&lt;p&gt;The cloud has been the default for many AI applications, offering seemingly infinite scale. However, relying solely on remote infrastructure comes with inherent risks. The recent CISA Admin leak of AWS GovCloud keys on GitHub is a stark, public reminder that even organizations with top-tier security face vulnerabilities. For our AI agents, especially those handling personal data or interacting with sensitive systems, entrusting everything to a third-party cloud provider introduces a control gap.&lt;/p&gt;

&lt;p&gt;This is where on-device AI agents truly shine. By running agents directly on your hardware, you retain control over the physical and logical environment. Building secure agents starts with a strong foundation. Think of the principles behind operating systems like OpenBSD 7.9, known for its "secure by default" philosophy and rigorous code auditing. While we might not be building entire operating systems, we can apply similar principles to our agent deployments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Isolation and Sandboxing&lt;/strong&gt;: Each agent or critical component should operate within its own confined environment. Tools like Docker containers, lightweight VMs, or even OS-level &lt;code&gt;chroot&lt;/code&gt; jails can isolate an agent's processes, file system access, and network interactions. This limits the blast radius if one agent component is compromised.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Conceptual example: Running an agent process securely
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_isolated_agent_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;script_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;environment_vars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Define a restricted environment
&lt;/span&gt;    &lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;environment_vars&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;environment_vars&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Basic sandboxing: ensure the script can only access specific paths
&lt;/span&gt;    &lt;span class="c1"&gt;# More advanced solutions involve Docker or chroot for stronger isolation
&lt;/span&gt;    &lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;python3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;script_path&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="c1"&gt;# Agent tasks should have time limits
&lt;/span&gt;        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Agent output:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Agent errors:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CalledProcessError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Agent task failed: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Stderr:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TimeoutExpired&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Agent task timed out.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Example usage:
# create a simple agent_task.py that writes to a specific file or performs a calc
# run_isolated_agent_task("path/to/your/agent_task.py", {"AGENT_MODE": "SECURE"})
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Principle of Least Privilege&lt;/strong&gt;: An agent should only have the minimum permissions necessary to perform its designated tasks. If an agent only needs to read a specific directory, it should not have write access to the entire file system. This applies to API keys, network access, and system commands.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Secure Communication&lt;/strong&gt;: For agents that do need to interact with external services, ensure all communication is encrypted (HTTPS, SSH). Avoid storing API keys directly in code; use secure environment variables or dedicated secret management tools.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These practices are not just for large enterprises; they are fundamental for anyone building automation that operates autonomously on their hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Efficiency and Cost: The Local Advantage
&lt;/h2&gt;

&lt;p&gt;Beyond security, the economics of AI are shifting. News reports about rising energy costs and data centers being at the heart of bids for energy companies highlight a significant trend: cloud computing is becoming more expensive, both financially and environmentally. Each query sent to a remote LLM incurs a cost, and that cost accumulates quickly.&lt;/p&gt;

&lt;p&gt;Running AI agents on your own consumer hardware offers a compelling alternative:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Reduced Operational Costs&lt;/strong&gt;: Once you've invested in your hardware, the operational costs for running local agents are primarily electricity, which is often far cheaper than continuous cloud API calls, especially for frequent or repetitive tasks.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Environmental Responsibility&lt;/strong&gt;: Decreasing reliance on massive, energy-intensive data centers contributes to a smaller carbon footprint.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Instantaneity and Data Locality&lt;/strong&gt;: Processing data locally removes network latency and ensures sensitive information never leaves your device, enhancing both speed and privacy. Apple's "Apple Intelligence" announcements underscore a future where powerful AI capabilities are deeply integrated and run on-device, prioritizing user data privacy and local processing power.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optimizing models for consumer hardware (e.g., using quantization, smaller models, or specialized runtimes like ONNX Runtime, OpenVINO, or Apple's Core ML) is a key engineering challenge. It requires careful selection of models that balance capability with resource constraints, ensuring your agents can perform their tasks effectively without bogging down your system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Agent Engineering for the "Long Hot AI Summer"
&lt;/h2&gt;

&lt;p&gt;As the AI space evolves rapidly, exemplified by major players like Meta reorienting thousands of employees towards AI development, the focus for engineers building agents must be on practical implementation and reliability. It's not enough for an agent to be intelligent; it must be dependable and resilient when operating independently on your devices.&lt;/p&gt;

&lt;p&gt;Consider these engineering points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Clear Task Definition&lt;/strong&gt;: Define the precise scope and goals of your agent. Avoid mission creep. A well-defined task makes it easier to test, monitor, and secure.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Error Handling and Recovery&lt;/strong&gt;: What happens if an external API fails? If an expected file isn't found? Agents need thorough error handling, retry mechanisms, and graceful degradation strategies to maintain operations.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Monitoring and Logging&lt;/strong&gt;: Even on local hardware, you need visibility. Implement clear logging (e.g., to local files, system logs) for agent actions, decisions, and any encountered errors. Monitoring resource usage (CPU, RAM, GPU) helps identify inefficiencies or runaway processes.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Version Control for Agents and Models&lt;/strong&gt;: Treat your agent code and the models it uses like any other critical software. Use Git for version control, allowing you to track changes, revert to stable versions, and collaborate effectively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building AI agents for personal and professional automation on consumer hardware is not just a technical challenge; it's an opportunity to build more private, efficient, and user-controlled systems. It requires a thoughtful approach to engineering, with security and efficiency at its core.&lt;/p&gt;

&lt;p&gt;Ready to build your own secure, autonomous AI agents? Explore tools and practices that put control back in your hands. Check out &lt;a href="https://dev.to/tools/agentguard"&gt;AgentGuard&lt;/a&gt; for resources designed to help you develop reliable and private AI automation on your local systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The dynamics of the AI world are shifting. From corporate realignments to increasing energy costs and critical security incidents, the environment demands a pragmatic approach to AI agent development. By prioritizing on-device security, optimizing for efficiency, and adopting rigorous engineering practices, we can build a future where AI agents empower us with intelligent automation that is truly ours, operating securely and effectively right where we need it.&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>automation</category>
      <category>ondeviceai</category>
      <category>security</category>
    </item>
    <item>
      <title>Decoding the AI Summer: Building Accountable Agents for the User</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Tue, 19 May 2026 14:45:10 +0000</pubDate>
      <link>https://dev.to/pat9000/decoding-the-ai-summer-building-accountable-agents-for-the-user-5fon</link>
      <guid>https://dev.to/pat9000/decoding-the-ai-summer-building-accountable-agents-for-the-user-5fon</guid>
      <description>&lt;h1&gt;
  
  
  Decoding the AI Summer: Building Accountable Agents for the User
&lt;/h1&gt;

&lt;p&gt;The air in the AI world is thick with change. Recent headlines paint a vivid picture of a technology in flux: colossal legal battles, major corporate reassignments, and even high-level discussions on AI ethics reaching the Vatican. This isn't just a moment of rapid advancement; it's what some are calling the "Long Hot A.I. Summer" - a period demanding vigilance, adaptability, and above all, a renewed focus on the user.&lt;/p&gt;

&lt;p&gt;As developers building AI agents on consumer hardware, this climate presents both immense opportunity and significant responsibility. While the giants clash and redirect their vast resources, we have the unique position to craft agents that truly serve, protect, and empower the individual. But how do we build agents that aren't just smart, but also trustworthy and accountable in this fast-evolving environment?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Shifting Sands of AI Development
&lt;/h2&gt;

&lt;p&gt;Elon Musk's recent lawsuits against OpenAI, and the subsequent "takeaways" from those blockbuster trials, underscore the intense competition and often unpredictable nature of the AI industry. These legal clashes laid bare the commercial interests and philosophical divides at the core of today's AI development. Simultaneously, Meta reassigning 7,000 employees to focus squarely on AI sends a clear message: AI is now center stage for major players, demanding a reorientation of entire corporate structures.&lt;/p&gt;

&lt;p&gt;For us, working with agents on local hardware, these shifts highlight a critical advantage: independence. While cloud-based AI can be subject to corporate whims, API changes, and shifting service models, an agent running on your device offers a degree of stability and control that centralized systems simply cannot match. This independence, however, comes with its own imperative: we must ensure these agents operate with the highest ethical standards, directly by and for the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Black Boxes: The Imperative for Ethical Agents
&lt;/h2&gt;

&lt;p&gt;The conversation around AI isn't confined to boardrooms and courtrooms. The news of Anthropic's co-founder joining Pope Leo XIV to present an AI encyclical, "Magnifica Humanitas," signals a global, philosophical engagement with AI's profound implications. It's a call for AI to serve humanity, not just generate profits or enhance surveillance.&lt;/p&gt;

&lt;p&gt;Contrast this with situations like Shutterstock's $35 million settlement over hard-to-cancel subscriptions. This isn't an AI story directly, but it's a powerful reminder of how opaque systems and design choices can erode user trust. When a user feels trapped or misled, it damages the entire relationship. This principle applies directly to AI agents: if an agent operates without transparency or clear user control, it risks repeating these same trust-breaking patterns.&lt;/p&gt;

&lt;p&gt;Even more concerning are proposals like the FBI's desire to buy nationwide access to license plate readers. This demonstrates the inherent tension between convenience, data collection, and individual privacy. As AI agents become more capable of gathering and acting on data, we, as developers, must be incredibly intentional about safeguarding user privacy and preventing any potential for misuse.&lt;/p&gt;

&lt;p&gt;For agents running on consumer hardware, &lt;em&gt;we&lt;/em&gt; are the gatekeepers of user trust. Our responsibility is to build agents that are inherently observable, accountable, and designed with user agency at their core. This means moving beyond the idea of an AI agent as a black box and towards a transparent, collaborative partner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Engineering Observable and User-Centric Agents
&lt;/h2&gt;

&lt;p&gt;How do we translate these ethical imperatives into practical engineering decisions for AI agents on consumer hardware? It starts with a commitment to clarity and control.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transparent State and Action Logging:&lt;/strong&gt;&lt;br&gt;
Every significant decision, data interaction, or workflow step an agent performs should be logged locally and made accessible to the user. This isn't just for debugging; it's for building trust. Imagine an agent automating a website interaction, much like the dynamic observation required on a site like &lt;code&gt;clickclickclick.click&lt;/code&gt;. Instead of just executing a 'click,' a truly accountable agent logs: "Detected 'Proceed to Checkout' button. Preparing to click. User granted permission for this action at 10:35 AM." This provides an audit trail and insight into the agent's reasoning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Confirmation and Override Hooks:&lt;/strong&gt;&lt;br&gt;
For any high-impact action-be it a financial transaction, data deletion, or sending sensitive information-the agent should pause and explicitly request user confirmation. This can be a simple notification on the user's device, providing a moment for review and the option to override.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;confirm_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action_description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Agent requires confirmation for: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;action_description&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Proceed? (yes/no): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;yes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;# Example usage in an agent workflow
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;detects_purchase_opportunity&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;confirm_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Initiating purchase of item X for $Y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute_purchase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;User declined purchase action.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Granular Permissions and Sandboxing (Locally):&lt;/strong&gt;&lt;br&gt;
Since we're building on consumer hardware, we have direct control over the execution environment. Design your agents with the principle of least privilege. Grant only the necessary system permissions, and explore OS-level sandboxing features, virtual environments, or containerization to limit the agent's scope and prevent unintended side effects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User-Adjustable Guardrails:&lt;/strong&gt;&lt;br&gt;
Empower users to define the boundaries of their agents' behavior. This could involve simple settings like "Only automate tasks between 9 AM and 5 PM" or "Never spend more than $50 without explicit approval." These user-configurable constraints allow individuals to tailor agent autonomy to their comfort level, ensuring the agent remains a tool, not a master.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Path Forward: Trust Through Engineering
&lt;/h2&gt;

&lt;p&gt;The "Long Hot A.I. Summer" is a period of intense growth and significant ethical discourse. For us, building AI agents on local hardware, it's a powerful affirmation of our mission: to create intelligent automation that is not only powerful but also transparent, accountable, and deeply respectful of user agency and privacy. By focusing on observable actions, user confirmation, and controlled environments, we can build a future where AI agents are truly extensions of the user's will, fostering trust through superior engineering.&lt;/p&gt;

&lt;p&gt;Want to ensure your agents are not just smart, but trustworthy and user-controlled? Explore tools designed for building secure and observable agents on your hardware. Check out our resources at &lt;a href="https://dev.to/tools/agentguard"&gt;/tools/agentguard&lt;/a&gt; to learn more about protecting user privacy and ensuring ethical agent operation.&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>usercontrol</category>
      <category>ethicalai</category>
      <category>localai</category>
    </item>
    <item>
      <title>BMD HODL devlog - week of 2026-05-17</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Tue, 19 May 2026 14:45:07 +0000</pubDate>
      <link>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-05-17-4nde</link>
      <guid>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-05-17-4nde</guid>
      <description>&lt;h1&gt;
  
  
  BMD HODL devlog - week of 2026-05-17
&lt;/h1&gt;

&lt;p&gt;From 2026-05-10 through 2026-05-17, the biggest move was getting stricter about proof. I cleaned up the AgentGuard funnel and numbers on &lt;code&gt;bmdpat&lt;/code&gt;, kept &lt;code&gt;agent47&lt;/code&gt; in maintenance mode, and let autotrader tell the truth instead of forcing a hero story. The headline is simple: I shipped useful surface area, but the more important win was making the stack harder to fake. AgentGuard still has no real external pull yet. Autotrader still trails passive. That is useful because it keeps me pointed at the real problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  What shipped
&lt;/h2&gt;

&lt;h3&gt;
  
  
  bmdpat
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #398: fixed the Bazaar x402 extension shape so indexed services see the right contract.&lt;/li&gt;
&lt;li&gt;PR #418: replaced the inflated AgentGuard download fallback with live pypistats.&lt;/li&gt;
&lt;li&gt;PR #419: rewrote the AgentGuard landing page to lead with MCP-native governance.&lt;/li&gt;
&lt;li&gt;PR #420: narrowed the lifetime AgentGuard counter to Pepy-only instead of mixing incompatible totals.&lt;/li&gt;
&lt;li&gt;PR #421: fixed blog excerpt metadata.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  agent47
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #467: improved the SDK first-run proof so the product story starts with a cleaner success path.&lt;/li&gt;
&lt;li&gt;PR #472: refreshed MCP indexing state and documented the blockers instead of pretending registry drift was fixed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  autotrader
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #16: added the CBRS post-IPO watchlist update for the paper-only V2 book.&lt;/li&gt;
&lt;li&gt;PR #17: logged the CBRS watchlist and power or colo queue note into the inbox flow.&lt;/li&gt;
&lt;li&gt;PR #18: landed the power and colo sentiment watchlist for GEV, VST, CEG, and ANET.&lt;/li&gt;
&lt;li&gt;PR #20: landed the stranded 2026-05-13 regime and watchlist knowledge updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;stratechery-inference-shift&lt;/code&gt; plus &lt;code&gt;tomtunguz-localmaxxing&lt;/code&gt;: local inference economics are now part of the product thesis, not side research.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;claude-code-programmatic-restrictions-2026-05-14&lt;/code&gt;: if an agent workflow depends on bundled pricing, I need the meter-read before I trust the lane.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;opensquilla-token-cost-agent&lt;/code&gt;: runtime spend control is getting crowded, so AgentGuard needs proof of enforcement, not just download vanity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Numbers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Autotrader: combined book &lt;strong&gt;+6.4%&lt;/strong&gt; as of &lt;strong&gt;2026-05-16&lt;/strong&gt;, with &lt;strong&gt;-5.1% alpha vs SPY&lt;/strong&gt; on stocks and &lt;strong&gt;-10.3% alpha vs BTC&lt;/strong&gt; on crypto.&lt;/li&gt;
&lt;li&gt;Closed loops: &lt;strong&gt;0 install intents&lt;/strong&gt; and &lt;strong&gt;0 CTA clicks&lt;/strong&gt; in the 7-day readout dated &lt;strong&gt;2026-05-17&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;AgentGuard PyPI: &lt;strong&gt;483 installs over 7 days&lt;/strong&gt; in the &lt;strong&gt;2026-05-17&lt;/strong&gt; focus review. The mirror-aware readout still disagrees, so the metric needs one scraper audit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want hard budget limits and loop guards for coding agents, start here: &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;https://bmdpat.com/tools/agentguard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devlog</category>
      <category>weekly</category>
    </item>
    <item>
      <title>I gave an autotrader $360 and 30 days. I am not adding live money yet.</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Fri, 15 May 2026 21:09:29 +0000</pubDate>
      <link>https://dev.to/pat9000/i-gave-an-autotrader-360-and-30-days-i-am-not-adding-live-money-yet-5enj</link>
      <guid>https://dev.to/pat9000/i-gave-an-autotrader-360-and-30-days-i-am-not-adding-live-money-yet-5enj</guid>
      <description>&lt;h1&gt;
  
  
  I gave an autotrader $360 and 30 days. I am not adding live money yet.
&lt;/h1&gt;

&lt;p&gt;On May 14 I ran the kill-switch review on the live autotrader.&lt;/p&gt;

&lt;p&gt;The decision is simple.&lt;/p&gt;

&lt;p&gt;Keep V2 paper-only. Add no new live money. Revisit after the next scorecard.&lt;/p&gt;

&lt;p&gt;That is not a dramatic kill. It is the boring version of discipline. The live book can keep being watched, but the next tranche does not go in just because I built the thing.&lt;/p&gt;

&lt;p&gt;This is part of BMD HODL, the one-person AI-operated holding company I run nights and weekends. The cannon for this quarter says watch first, document everything, and decide from the rule instead of the sunk cost.&lt;/p&gt;

&lt;p&gt;Today was the rule.&lt;/p&gt;




&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Two live accounts. Real money.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alpaca stocks: $200 deposited&lt;/li&gt;
&lt;li&gt;Kraken crypto: $160 deposited&lt;/li&gt;
&lt;li&gt;Total live: $360&lt;/li&gt;
&lt;li&gt;Compute: about $57 a month on Azure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The strategy is markdown-prompt-driven. Claude reads positions, market context, and a small playbook every morning. It proposes or manages trades inside guardrails.&lt;/p&gt;

&lt;p&gt;Paper trading keeps running in parallel as the test bed. Any strategy change has to prove itself on paper before it touches live money.&lt;/p&gt;

&lt;p&gt;That separation matters. Live money is where discipline gets tested. Paper is where experiments belong.&lt;/p&gt;




&lt;h2&gt;
  
  
  The numbers
&lt;/h2&gt;

&lt;p&gt;Latest verified snapshot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alpaca equity: $217.97 (+9.0% on $200)&lt;/li&gt;
&lt;li&gt;Kraken equity: $169.87 (+6.2% on $160)&lt;/li&gt;
&lt;li&gt;Combined: $387.84 (+7.7% on $360)&lt;/li&gt;
&lt;li&gt;Net of monthly compute: roughly minus $29&lt;/li&gt;
&lt;li&gt;vs SPY over the same window: minus 4.4%&lt;/li&gt;
&lt;li&gt;vs BTC over the same window: minus 10.2%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In isolation, +7.7% on $360 looks fine.&lt;/p&gt;

&lt;p&gt;After compute, it is negative.&lt;/p&gt;

&lt;p&gt;Against passive baselines, it is behind.&lt;/p&gt;

&lt;p&gt;That is the whole point of the review. The bot does not get credit for being interesting. It has to beat the boring alternative or earn more time with better evidence.&lt;/p&gt;




&lt;h2&gt;
  
  
  The rule
&lt;/h2&gt;

&lt;p&gt;The rule was written before the money went in.&lt;/p&gt;

&lt;p&gt;If the live book is still net-negative after compute and still lagging both SPY and BTC, no new live tranche goes in.&lt;/p&gt;

&lt;p&gt;If the live book is positive after compute or one benchmark has flipped, it can continue to the next tranche.&lt;/p&gt;

&lt;p&gt;Today the rule says no new live money.&lt;/p&gt;

&lt;p&gt;I am not routing the next $200 into the bot today. I am keeping V2 paper-only and waiting for the next scorecard.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I am not doing
&lt;/h2&gt;

&lt;p&gt;I am not declaring the system dead.&lt;/p&gt;

&lt;p&gt;I am not pretending the result is good enough.&lt;/p&gt;

&lt;p&gt;I am not changing the benchmark after the fact.&lt;/p&gt;

&lt;p&gt;The live account did make money before compute. That matters. It also lost to the actual alternatives. That matters more.&lt;/p&gt;

&lt;p&gt;The useful middle ground is to keep the live book contained, keep the paper system learning, and only promote capital when the scoreboard earns it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Most builders are good at starting systems and bad at slowing them down.&lt;/p&gt;

&lt;p&gt;Agents make that worse. Once a process runs on a schedule, it starts to feel alive. It produces logs. It writes reports. It gives you reasons to keep watching.&lt;/p&gt;

&lt;p&gt;That is exactly why the rule has to exist before the result.&lt;/p&gt;

&lt;p&gt;The rule is not there to punish the agent. It is there to protect the operator from narrative drift.&lt;/p&gt;

&lt;p&gt;This autotrader is useful if it teaches me how to run capital with agents without getting high on my own software.&lt;/p&gt;

&lt;p&gt;Today it taught the right lesson.&lt;/p&gt;

&lt;p&gt;No new live money without better evidence.&lt;/p&gt;




&lt;h2&gt;
  
  
  The next scorecard
&lt;/h2&gt;

&lt;p&gt;The next review is not vibes.&lt;/p&gt;

&lt;p&gt;I want to see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Net result after compute&lt;/li&gt;
&lt;li&gt;Combined book versus SPY and BTC&lt;/li&gt;
&lt;li&gt;Paper V2 hit rate&lt;/li&gt;
&lt;li&gt;Cash drag&lt;/li&gt;
&lt;li&gt;Whether the strategy is learning from misses or just writing prettier reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If those improve, I can add capital later.&lt;/p&gt;

&lt;p&gt;If they do not, the live book stays capped and the next dollar goes somewhere boring.&lt;/p&gt;

&lt;p&gt;That is not a failure. That is the system working.&lt;/p&gt;




&lt;p&gt;If you are running agents near money, customers, or production, write the kill-switch before the run starts. That is what I built &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;AgentGuard&lt;/a&gt; for. Budget caps, category caps, and breach hooks around agent loops.&lt;/p&gt;

&lt;p&gt;Write the rule first. Code the rule next. Then let the result tell you what to do.&lt;/p&gt;

</description>
      <category>autotrader</category>
      <category>agentruntimesafety</category>
      <category>killswitch</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>An AI Agent in Sweden Ordered 6,000 Napkins. Here's the 12 Lines of Python That Would Have Stopped It.</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Fri, 15 May 2026 21:08:20 +0000</pubDate>
      <link>https://dev.to/pat9000/an-ai-agent-in-sweden-ordered-6000-napkins-heres-the-12-lines-of-python-that-would-have-stopped-37gi</link>
      <guid>https://dev.to/pat9000/an-ai-agent-in-sweden-ordered-6000-napkins-heres-the-12-lines-of-python-that-would-have-stopped-37gi</guid>
      <description>&lt;p&gt;A cafe in Sweden handed its AI purchasing agent a corporate card and told it to keep the shop stocked. Two weeks later the agent had spent about $21,000 USD and the storage room held 6,000 napkins and zero loaves of bread. The AP picked it up on May 13. Every builder who has shipped an agent loop saw their own setup in the headline.&lt;/p&gt;

&lt;p&gt;Here is what happened, the 12-line wrapper that would have stopped it, and the part the tool does not solve.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the cafe actually did wrong
&lt;/h2&gt;

&lt;p&gt;The owner wired a model up to a supplier ordering API. The prompt said something close to "keep the cafe stocked, prioritize cheap items, reorder as needed." There was no per-category cap. No daily dollar cap. No anomaly check on quantity. No human review on orders over a threshold.&lt;/p&gt;

&lt;p&gt;The agent did exactly what the prompt rewarded. Napkins were cheap per unit. The reorder logic had no memory of prior orders inside the same window. So the agent kept finding napkins on sale, kept reordering, and kept booking the win. Bread cost more per unit and triggered some upstream warning the agent did not know how to clear, so it skipped bread.&lt;/p&gt;

&lt;p&gt;Three weeks of compounding the same decision. $21K gone. The cafe owner said the agent was "doing its job."&lt;/p&gt;

&lt;h2&gt;
  
  
  The four-bullet root cause
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No dollar budget on the agent process itself.&lt;/li&gt;
&lt;li&gt;No per-category cap, so napkins could absorb the entire budget.&lt;/li&gt;
&lt;li&gt;No anomaly trigger when the same SKU got reordered N times in a window.&lt;/li&gt;
&lt;li&gt;No kill switch tied to spend velocity. The bill only surfaced at month end.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any single one of those guardrails contains the incident. Two of them prevent it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 12 lines that stop this
&lt;/h2&gt;

&lt;p&gt;This is AgentGuard, the runtime budget wrapper I maintain. The shape is the point, not the brand. Any equivalent works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;agentguard47&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AgentGuard&lt;/span&gt;

&lt;span class="n"&gt;guard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AgentGuard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;daily_usd_cap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;per_category_caps&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;napkins&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;paper_goods&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;rate_limit_per_minute&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;on_breach&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;kill_process&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;alert_webhook&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://hooks.slack.com/...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;guard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cafe-purchasing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Twelve lines. Here is what each line buys you in the Sweden scenario:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;daily_usd_cap=200&lt;/code&gt; ends the process the moment cumulative spend that day hits $200. The cafe burned about $1,500 per day on average. The wrapper kills the loop on day one, hour two.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;per_category_caps={"napkins": 20, ...}&lt;/code&gt; is the line that specifically prevents this exact failure mode. Napkins cannot consume more than $20 of the daily budget. The third reorder fails closed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rate_limit_per_minute=10&lt;/code&gt; catches the runaway loop pattern where the agent keeps retrying the same call.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;on_breach="kill_process"&lt;/code&gt; is the part most builders skip. Logging a warning and continuing is not a guardrail. Killing the process is.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alert_webhook&lt;/code&gt; means you find out in Slack on day one, not on the credit card statement on day thirty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cafe owner does not need an AI safety team. He needs twelve lines of Python and a webhook URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not solve
&lt;/h2&gt;

&lt;p&gt;Be honest about the gap. Runtime budget rails are one layer. The cafe still has open problems even with the wrapper in place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bad supplier choice logic.&lt;/strong&gt; The agent picked napkins because the prompt rewarded cheap-per-unit. The wrapper does not fix the model's reasoning. That is a prompt and tool-design problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No human review on irreversible orders.&lt;/strong&gt; Supplier orders are mostly non-cancellable once placed. The wrapper kills future orders but does not undo the ones already in flight. Human review on any order over $X is a separate layer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vendor lock-in to the model's biases.&lt;/strong&gt; If the model has been trained to prefer certain brands or categories, the budget cap just rations the bad decision. It does not improve the decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The agent does not know it is wrong.&lt;/strong&gt; Inside the loop it is hitting the reward signal it was given. The wrapper is the external referee. Agents cannot referee themselves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the part the Sweden story is going to get wrong in coverage. People will say "the AI made a mistake" or "the AI was too aggressive." Neither is true. The AI did the cheapest possible thing inside the prompt it was given. The mistake was shipping the loop without an external referee.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern to steal
&lt;/h2&gt;

&lt;p&gt;If your agent has a credit card, a database password, an SSH key, or any other action surface where each call costs real money or causes real change, treat it like a junior employee with a corporate card. You would give the junior a per-category limit. You would set up a daily report. You would put a manager review on anything over a threshold. Same rules for the agent.&lt;/p&gt;

&lt;p&gt;The order of operations matters too. Most builders write the prompt first, ship the loop, watch the bill, then add guardrails. Reverse it. The wrapper is line one of the agent. The prompt is line two.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we ship in agent47
&lt;/h2&gt;

&lt;p&gt;The agent47 repo keeps a Real Incidents log. PocketOS losing prod was the first entry. Sweden napkins is the second. Pattern matters more than the punchline. In both cases the agent did what the loop rewarded and there was no external layer to say no.&lt;/p&gt;

&lt;p&gt;If you want the runtime spend layer, AgentGuard is one pip install and the snippet above is the whole API. It will not turn a bad prompt into a good one. It will stop a bad prompt from costing $21,000.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;Get AgentGuard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agentguard</category>
      <category>aisafety</category>
      <category>agentbudget</category>
      <category>incidentpostmortem</category>
    </item>
    <item>
      <title>AI software runs on 17% margins. SaaS runs on 70%. The token bill is the problem.</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Fri, 15 May 2026 21:08:17 +0000</pubDate>
      <link>https://dev.to/pat9000/ai-software-runs-on-17-margins-saas-runs-on-70-the-token-bill-is-the-problem-2cj3</link>
      <guid>https://dev.to/pat9000/ai-software-runs-on-17-margins-saas-runs-on-70-the-token-bill-is-the-problem-2cj3</guid>
      <description>&lt;h1&gt;
  
  
  AI software runs on 17% margins. SaaS runs on 70%. The token bill is the problem.
&lt;/h1&gt;

&lt;p&gt;A new analysis from Gptomics put a number on something every AI founder has been feeling. AI-native software businesses are running at about 17% gross margins. Traditional SaaS sits near 70%. The gap is the token bill.&lt;/p&gt;

&lt;p&gt;If you ship an AI product and your COGS line keeps creeping, this is why. You did not misprice on purpose. You repriced without noticing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the margin actually went
&lt;/h2&gt;

&lt;p&gt;A SaaS request costs you a few CPU cycles, some bandwidth, and a database read. Pennies on the thousand.&lt;/p&gt;

&lt;p&gt;An AI request costs you tokens. And it is rarely one request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One user message becomes 3 to 12 model calls once you add retrieval, tool use, and a planner.&lt;/li&gt;
&lt;li&gt;Retries on rate-limit or 5xx errors double the bill on a bad day.&lt;/li&gt;
&lt;li&gt;Evals and guardrails run their own model calls on every turn.&lt;/li&gt;
&lt;li&gt;Memory and context grow, so input tokens grow, so every subsequent call gets more expensive.&lt;/li&gt;
&lt;li&gt;Long-running agents loop. A single stuck agent can burn $40 in an afternoon before anyone notices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You priced the product like a SaaS app. You are operating it like a call center where every minute on the phone is metered.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three founder mistakes that lock you at 17%
&lt;/h2&gt;

&lt;p&gt;I have looked at a lot of AI agent deployments in the last year. The same three holes show up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. No hard cost cap per user, per tenant, or per session.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a single power user can spend $200 in a week on a $29 subscription, you are not running a SaaS business. You are running an unhedged short on token prices. The fix is a budget at the entity level, enforced before the model call, not in a dashboard you check on Monday.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. No model fallback ladder.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every call goes to your best model. Most of those calls did not need it. A two-step ladder of cheap-first, escalate-on-failure cuts 40 to 70% of token spend on the routes I have actually measured. The work is not glamorous. The savings are.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. No per-tenant telemetry on token spend.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You know revenue per customer. You do not know cost per customer. So when a whale starts costing you more than they pay, you find out at quarter close. By then it has been three months.&lt;/p&gt;

&lt;p&gt;These three holes are how a 70% margin product becomes a 17% margin product without anyone shipping a bad decision. Each one is a small omission that compounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What 30%+ margins look like
&lt;/h2&gt;

&lt;p&gt;You are not getting back to SaaS 70%. The token bill is real. But 30 to 45% is doable, and that is the difference between a company and a science project.&lt;/p&gt;

&lt;p&gt;The pattern that works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Budget caps at every layer.&lt;/strong&gt; Per user, per workspace, per route. Hard stops, not warnings. When the cap hits, the request gets a graceful degraded response, not a $14 invoice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A fallback ladder.&lt;/strong&gt; Cheap model first. Escalate only when the cheap model fails an eval or the user retries. Default to the floor, not the ceiling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token telemetry per tenant.&lt;/strong&gt; Every call tagged with user_id, tenant_id, route, model. Cost-per-customer becomes a number on a dashboard, not a quarterly surprise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loop detection.&lt;/strong&gt; Any agent that calls the model more than N times for one task gets killed. Stuck agents are the single biggest blow-up risk on a token bill.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can build this yourself. Most teams do, badly, after the first surprise invoice. Or you can drop in something that already does it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I wrote AgentGuard for exactly this. It is a Python SDK that wraps your model calls and enforces budgets, fallback, and telemetry at the call site. No new infra. No proxy server. Pip install and add a decorator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;agentguard47
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is the boring infrastructure layer the AI stack still does not have a default for. If you are sitting at 17% margins and trying to figure out where the leak is, start here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;Go to AgentGuard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>uniteconomics</category>
      <category>agentguard</category>
      <category>pricing</category>
    </item>
    <item>
      <title>Enterprise AI just shifted: Claude +128%, OpenAI -8%. What it means if you're building.</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Fri, 15 May 2026 14:45:14 +0000</pubDate>
      <link>https://dev.to/pat9000/enterprise-ai-just-shifted-claude-128-openai-8-what-it-means-if-youre-building-1jfl</link>
      <guid>https://dev.to/pat9000/enterprise-ai-just-shifted-claude-128-openai-8-what-it-means-if-youre-building-1jfl</guid>
      <description>&lt;p&gt;SaaStr published Q2 enterprise AI usage numbers this week. The shape:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude: +128%&lt;/li&gt;
&lt;li&gt;Gemini: +48%&lt;/li&gt;
&lt;li&gt;OpenAI: -8%&lt;/li&gt;
&lt;li&gt;Grok: rounding error&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the cleanest single-quarter share shift I have seen in this space all year. And the obvious read is wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lazy take
&lt;/h2&gt;

&lt;p&gt;The lazy take is "Anthropic won, switch to Claude." If you ship that take, you are the same person who told their team to standardize on OpenAI 18 months ago. The whole point of the chart is that single-vendor positions move 100+ points in 90 days now.&lt;/p&gt;

&lt;p&gt;The data is not telling you which model to pick. It is telling you that picking is a recurring decision, not a one-time one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is actually driving the shift
&lt;/h2&gt;

&lt;p&gt;Three things, near as I can tell from talking to builders shipping agents in production:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Coding agents.&lt;/strong&gt; Claude Code and the Sonnet line ate the developer market. Once a developer is in Claude all day for code, they tend to reach for the same API for their app's agent calls. Developer mindshare leaks into procurement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentic retention.&lt;/strong&gt; Long-horizon tool-use tasks reward models that follow instructions and recover from errors. Teams that built real agentic workflows on Claude 3.7 and 4 stuck around.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI cycle gap.&lt;/strong&gt; GPT-5 landed but did not produce a Claude-Code-tier shift inside engineering orgs. Distribution from ChatGPT is consumer, not enterprise API usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these are permanent. Gemini 3 is coming. OpenAI ships something every six weeks. The chart will look different in October.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means if you are building
&lt;/h2&gt;

&lt;p&gt;If you are building an agent or AI feature today, the share data is a forcing function. Three concrete moves:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Put a model abstraction layer in front of every call.&lt;/strong&gt; Not a 400-line framework. Just one function in your codebase that takes a prompt and a job type and decides which model and which provider. The function reads from config, not from the call site. When the next chart flips, you change one file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Wrap every agent in a budget.&lt;/strong&gt; Cost per task varies 5x between providers and 10x inside a single provider's tier list. Without a cap, a model switch can blow your unit economics overnight. This is exactly what AgentGuard does. Install it, set a per-task ceiling in dollars, the agent stops when it hits the cap. Two lines of Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Run a real eval before you migrate.&lt;/strong&gt; "Claude is better" is not a procurement decision. Pick your 20 hardest production tasks, run them through three models, score the outputs. The eval becomes a regression suite the next time you re-evaluate. Most teams never build this and that is why they re-platform every nine months on vibes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The deeper pattern
&lt;/h2&gt;

&lt;p&gt;Every share chart in this space is going to whipsaw for at least another two years. The infrastructure decision is not "which model." It is "how fast can I switch which model." Teams that hard-code one provider into prompts, retry logic, observability, and billing are paying a re-platforming tax every other quarter.&lt;/p&gt;

&lt;p&gt;The teams that compound are the ones treating the model as a hot-swappable component. Eval suite, abstraction layer, cost cap, done. Then read the next share chart and move on with your day.&lt;/p&gt;

&lt;p&gt;If you want the cost-cap part for free: &lt;code&gt;pip install agentguard47&lt;/code&gt;. &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;AgentGuard&lt;/a&gt; is a 2-line runtime budget guard for agents. It does the cap, the token limit, the rate limit. Use it, do not use it, but do not ship an agent without one.&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>modelrouting</category>
      <category>costcontrol</category>
      <category>agentguard</category>
    </item>
    <item>
      <title>Localmaxxing isn't theory. Here's what my 3-GPU rig actually does.</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Fri, 15 May 2026 14:45:10 +0000</pubDate>
      <link>https://dev.to/pat9000/localmaxxing-isnt-theory-heres-what-my-3-gpu-rig-actually-does-4acd</link>
      <guid>https://dev.to/pat9000/localmaxxing-isnt-theory-heres-what-my-3-gpu-rig-actually-does-4acd</guid>
      <description>&lt;p&gt;Tom Tunguz wrote a post this week called &lt;a href="https://tomtunguz.com/localmaxxing/" rel="noopener noreferrer"&gt;Localmaxxing&lt;/a&gt;. His thesis: open-weight models on prosumer hardware now match cloud-tier quality for a sliver of the cost. The gap closed. The math flipped.&lt;/p&gt;

&lt;p&gt;I've been running this setup for months. RTX 3070, RTX 5070 Ti, RTX 5090, all in one tower, serving Llama 3.1 8B through llama.cpp. So let me skip the thesis and put real numbers on the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rig
&lt;/h2&gt;

&lt;p&gt;One Threadripper box. Three GPUs. 80GB of total VRAM if you stack them, though I don't pool them for a single 8B model. I run Llama 3.1 8B in Q5_K_M quant. That fits comfortably on the 5090 alone with room to spare for a 32k context window.&lt;/p&gt;

&lt;p&gt;The 3070 and 5070 Ti run smaller models in parallel for different agent jobs. Embeddings on one, a 3B classifier on another. The 5090 is the workhorse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens per second on Llama 3.1 8B
&lt;/h2&gt;

&lt;p&gt;On the 5090, Q5_K_M, single batch, no flash-attention tweaks beyond defaults:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prompt processing: ~3,200 tok/s&lt;/li&gt;
&lt;li&gt;Generation: ~140 tok/s sustained&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For comparison, Claude Opus and GPT-4-class APIs land around 30-80 tok/s on generation depending on load. My local 8B is faster than the frontier cloud APIs for raw throughput. It's a smaller model, so output quality is lower for hard reasoning. For 80% of agent work (classify, extract, summarize, route, format), it's plenty.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost per million tokens
&lt;/h2&gt;

&lt;p&gt;Cloud reference points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GPT-4o: ~$5 input / $15 output per million&lt;/li&gt;
&lt;li&gt;Claude Sonnet 4.5: ~$3 input / $15 output per million&lt;/li&gt;
&lt;li&gt;Llama 3.1 8B on Together / Fireworks: ~$0.20 per million blended&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My local cost, including amortized hardware and Texas electricity at $0.11/kWh:&lt;/p&gt;

&lt;p&gt;The 5090 pulls about 400W under sustained inference. At 140 tok/s, one hour of generation produces 504,000 tokens for 0.4 kWh, or about 4.4 cents. That's $0.087 per million output tokens. Round it to 9 cents.&lt;/p&gt;

&lt;p&gt;Hardware amortization is the bigger line. Call it $2,200 for the 5090 over 3 years of mixed use. If the card pulls 1,000 hours of inference per year, that's $0.73 per hour, or about $1.45 per million tokens.&lt;/p&gt;

&lt;p&gt;Total all-in: roughly &lt;strong&gt;$1.55 per million output tokens&lt;/strong&gt; on local, versus $15 on Claude Sonnet for the same job class. Ten times cheaper.&lt;/p&gt;

&lt;p&gt;Caveat: I'm comparing an 8B model to frontier models. Apples to small oranges. But for the agent jobs where 8B is good enough, the math is settled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where local wins, where it doesn't
&lt;/h2&gt;

&lt;p&gt;Wins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-volume classification and extraction&lt;/li&gt;
&lt;li&gt;Anything privacy-sensitive (client data, medical, financial)&lt;/li&gt;
&lt;li&gt;Latency-sensitive interactive flows (no network round trip)&lt;/li&gt;
&lt;li&gt;Burst workloads that would smash cloud rate limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Loses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hard reasoning, multi-step planning, code generation at frontier quality&lt;/li&gt;
&lt;li&gt;Anything where you actually need the model's knowledge depth&lt;/li&gt;
&lt;li&gt;Workloads with idle gaps where the GPU sits dark and you eat the depreciation anyway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The right move for most builders right now is hybrid. Cloud frontier for the hard 20%. Local 8B or 14B for the routine 80%. Route between them based on task class.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Tunguz is actually saying
&lt;/h2&gt;

&lt;p&gt;His VC framing matters. When Tunguz posts about local LLMs, every CTO who reads his Sunday digest just got cover to take this seriously. The conversation moved from "Patrick's weird hobby rig" to "tier-1 VC thesis" in one blog post.&lt;/p&gt;

&lt;p&gt;If you've been waiting for permission to test a local-first or hybrid architecture, this is it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for cost-controlled agents
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;AgentGuard&lt;/a&gt; because cost is the thing that kills agent projects in production. Local LLMs don't make cost discipline optional. They make it more important, because now you have three cost dimensions (cloud spend, local electricity, local hardware amortization) instead of one.&lt;/p&gt;

&lt;p&gt;The same AgentGuard policies that cap your cloud budget should cap your local inference budget too. A runaway loop on a local model still burns wattage, still keeps your GPU at 90C, still pegs your CPU. Free at the margin doesn't mean free in practice.&lt;/p&gt;

&lt;p&gt;If you want to dig deeper into the consumer-GPU production setup, I wrote about &lt;a href="https://bmdpat.com/blog/local-llm-inference-consumer-gpu-production-2026" rel="noopener noreferrer"&gt;running local LLM inference on consumer GPUs&lt;/a&gt; earlier this year. That post covers the stack choices, the quant tradeoffs, and the model-routing logic I use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;Localmaxxing is real. The numbers are real. The hardware is in stock. The tools are stable.&lt;/p&gt;

&lt;p&gt;If you're building agents and your cloud bill is climbing, the answer might not be a better prompt or a cheaper model tier. It might be a $2,000 GPU and a weekend with llama.cpp.&lt;/p&gt;

&lt;p&gt;Then put a budget on it. &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;AgentGuard&lt;/a&gt; handles that part.&lt;/p&gt;

</description>
      <category>localllm</category>
      <category>aieconomics</category>
      <category>agentcostcontrol</category>
      <category>gpuinference</category>
    </item>
    <item>
      <title>BMD HODL devlog - week of 2026-04-26</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Thu, 14 May 2026 14:45:13 +0000</pubDate>
      <link>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-04-26-3h14</link>
      <guid>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-04-26-3h14</guid>
      <description>&lt;p&gt;This week I stopped pretending I needed to hand-pick every move. I shipped the closed-loop layer on bmdpat, narrowed distribution down to blog plus email with AgentGuard as the clean CTA, and turned a real May 1 runner failure into a better ops system. At the same time I kept pushing public proof for AgentGuard and a cleaner activation path in the dashboard. The good part is that the signals are now measurable. The bad part is that the weak spots are measurable too. ## What shipped ### bmdpat - PR #240: cleaned up &lt;code&gt;/audit&lt;/code&gt; so the page dropped the pink flood and kept the AgentGuard CTA in accent lime.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PR #239: tightened the &lt;code&gt;/audit&lt;/code&gt; color pass again so one CTA owns the brand color.&lt;/li&gt;
&lt;li&gt;PR #238: narrowed the healthcare regex so &lt;code&gt;patient&lt;/code&gt;, &lt;code&gt;clinic&lt;/code&gt;, and &lt;code&gt;pharma&lt;/code&gt; stop overmatching on &lt;code&gt;/audit&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #235: added the AgentGuard roadmap funnel.&lt;/li&gt;
&lt;li&gt;PR #234: fixed the exit-intent modal so it closes on route change.&lt;/li&gt;
&lt;li&gt;PR #233: shipped the self-serve AI agent roadmap generator as Product #2.&lt;/li&gt;
&lt;li&gt;PR #232: shipped the registry-driven catalog plus the &lt;code&gt;⌘K&lt;/code&gt; palette.&lt;/li&gt;
&lt;li&gt;PR #231: added the &lt;code&gt;/agent-architect&lt;/code&gt; landing page.&lt;/li&gt;
&lt;li&gt;PR #230: killed the old audit pricing framing and reassigned Product #2 to the roadmap generator.&lt;/li&gt;
&lt;li&gt;PR #228: logged the Above the API Line ship in the inbox trail.&lt;/li&gt;
&lt;li&gt;PR #227: shipped AgentPay, the YC demo with hard USDC spend limits.&lt;/li&gt;
&lt;li&gt;PR #226: remapped the demo slate to the real YC Summer 2026 RFS list.&lt;/li&gt;
&lt;li&gt;PR #225: shipped Above the API Line.&lt;/li&gt;
&lt;li&gt;PR #224: fixed the server build by externalizing &lt;code&gt;jose&lt;/code&gt; and &lt;code&gt;@coinbase/cdp-sdk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #223: shipped the Company Brain YC demo.&lt;/li&gt;
&lt;li&gt;PR #222: fixed the blog workflow by adding the missing &lt;code&gt;feedparser&lt;/code&gt; and &lt;code&gt;google-generativeai&lt;/code&gt; dependencies.&lt;/li&gt;
&lt;li&gt;PR #221: shipped HeatCheck.&lt;/li&gt;
&lt;li&gt;PR #220: wired closed-loop tracking into DroneEar.&lt;/li&gt;
&lt;li&gt;PR #219: shipped OrbitBrief.&lt;/li&gt;
&lt;li&gt;PR #218: fixed DroneEar classification with feature-based reconcile and better countermeasures.&lt;/li&gt;
&lt;li&gt;PR #217: shipped the DroneEar acoustic drone detection demo.&lt;/li&gt;
&lt;li&gt;PR #216: wired closed-loop tracking and live-count derivation into Reshore.&lt;/li&gt;
&lt;li&gt;PR #215: logged the Cite-or-Lie polish pass in the inbox trail.&lt;/li&gt;
&lt;li&gt;PR #214: logged the Reshore ship in the inbox trail.&lt;/li&gt;
&lt;li&gt;PR #213: improved Cite-or-Lie by dropping low-quality hosts and forcing evidence-gap framing.&lt;/li&gt;
&lt;li&gt;PR #212: wired all three YC demos into closed-loop tracking.&lt;/li&gt;
&lt;li&gt;PR #211: added the Stripe Link rail beside USDC and x402 on &lt;code&gt;/memory&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #210: shipped Reshore, the YC demo for US-vs-China BoM cost deltas.&lt;/li&gt;
&lt;li&gt;PR #208: upgraded Crop Doctor with home-gardener-grade tips and the Maverick vision model.&lt;/li&gt;
&lt;li&gt;PR #207: logged the Cite-or-Lie demo in the inbox trail.&lt;/li&gt;
&lt;li&gt;PR #206: fixed Tax Deduction Finder with server-side totals and 2025 IRS rates.&lt;/li&gt;
&lt;li&gt;PR #205: shipped Cite-or-Lie.&lt;/li&gt;
&lt;li&gt;PR #203: fixed Crop Doctor by killing the 504 path and renaming the route to &lt;code&gt;/yc/s26/cropdoctor&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #202: shipped AI Tax Deduction Finder.&lt;/li&gt;
&lt;li&gt;PR #201: shipped the first-party closed-loops foundation.&lt;/li&gt;
&lt;li&gt;PR #200: shipped Crop Doctor and the YC RFS landing.&lt;/li&gt;
&lt;li&gt;PR #195: shipped the AI disaster wall at &lt;code&gt;/ai-fails&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #193: repositioned &lt;code&gt;/memory&lt;/code&gt; to lead with the spaceship, not the engine.&lt;/li&gt;
&lt;li&gt;PR #192: tightened numbered-list spacing on &lt;code&gt;/memory&lt;/code&gt; and &lt;code&gt;/memory/demo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #191: fixed &lt;code&gt;/pod&lt;/code&gt; so persona reply history no longer overwrites prior replies. ### agent47 - PR #423: pointed demo users to quickstart activation.&lt;/li&gt;
&lt;li&gt;PR #422: switched PyPI releases to Trusted Publishing.&lt;/li&gt;
&lt;li&gt;PR #420: improved repo trust and OSS onboarding.&lt;/li&gt;
&lt;li&gt;PR #419: polished the README for GitHub discovery.&lt;/li&gt;
&lt;li&gt;PR #415: tightened the activation proof path.&lt;/li&gt;
&lt;li&gt;PR #413: cleared the completed follow-up queue.&lt;/li&gt;
&lt;li&gt;PR #412: handled missing release discussion categories.&lt;/li&gt;
&lt;li&gt;PR #408: documented the opt-in activation metrics design.&lt;/li&gt;
&lt;li&gt;PR #407: logged PR #406 and updated the follow-up trail.&lt;/li&gt;
&lt;li&gt;PR #406: refreshed the SDK ops docs.&lt;/li&gt;
&lt;li&gt;PR #405: logged the PR #404 handoff.&lt;/li&gt;
&lt;li&gt;PR #404: added coding-agent review-loop proof.&lt;/li&gt;
&lt;li&gt;PR #403: logged the queue README datapoint PR.&lt;/li&gt;
&lt;li&gt;PR #402: added the Uber AI budget datapoint to the README.&lt;/li&gt;
&lt;li&gt;PR #400: added the AI contribution policy section.&lt;/li&gt;
&lt;li&gt;PR #391: released v1.2.9.&lt;/li&gt;
&lt;li&gt;PR #390: aligned SDK decision traces with the dashboard runtime-control contract. ### agent47-dashboard - PR #144: added the distribution partner playbook.&lt;/li&gt;
&lt;li&gt;PR #143: added readiness recommended actions.&lt;/li&gt;
&lt;li&gt;PR #142: added alert delivery health.&lt;/li&gt;
&lt;li&gt;PR #141: added share-demo loop metrics.&lt;/li&gt;
&lt;li&gt;PR #139: pushed first-trace users toward their first control.&lt;/li&gt;
&lt;li&gt;PR #138: added the CrewAI live topology view.&lt;/li&gt;
&lt;li&gt;PR #137: hardened release-operator enforcement.&lt;/li&gt;
&lt;li&gt;PR #136: added the pilot feedback loop.&lt;/li&gt;
&lt;li&gt;PR #135: protected preview dashboard routes.&lt;/li&gt;
&lt;li&gt;PR #134: added the retained activation funnel.&lt;/li&gt;
&lt;li&gt;PR #133: added the pilot response ops loop.&lt;/li&gt;
&lt;li&gt;PR #132: added the pilot intake landing loop.&lt;/li&gt;
&lt;li&gt;PR #131: added activation telemetry and release-operator dogfooding.&lt;/li&gt;
&lt;li&gt;PR #130: cleared the dashboard security audit queue. ### autotrader - No merged PRs this week. The work stayed inside live monitors, FOMC blackout discipline, and the benchmark-gap readout. ## What I learned - &lt;code&gt;2026-04-30-openrouter-opus-47-tokenizer-cost&lt;/code&gt;: pricing drift is product risk now. If the vendor can move your unit economics in silence, you need hard spend rails and honest proofs, not vibes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2026-05-02-dow-frontier-ai-classified-deals-anthropic-excluded&lt;/code&gt;: vendor politics now matter as much as model quality. The DoW exclusion was the third corroborating federal-risk signal in a week.&lt;/li&gt;
&lt;li&gt;HoldcoBrain was a good same-day kill. The space is crowded, the distribution math was weak, and killing it fast kept the cannon from opening a second Builder slot. ## Numbers - Autotrader closed the week up &lt;strong&gt;6.9%&lt;/strong&gt;, with &lt;strong&gt;SPY alpha -2.7%&lt;/strong&gt; on stocks and &lt;strong&gt;BTC alpha -8.8%&lt;/strong&gt; on crypto. The kill-switch eval stays set for &lt;strong&gt;2026-05-14&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Closed loops ended the week at &lt;strong&gt;9 install intents over the rolling 7-day readout&lt;/strong&gt;, on &lt;strong&gt;63 total events&lt;/strong&gt; and &lt;strong&gt;85.71% CTA-to-install session conversion&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;AgentGuard sat at &lt;strong&gt;451 PyPI downloads in the last 7 days&lt;/strong&gt; as of the 2026-05-03 metrics scrape. If you're building agents and you want hard runtime spend and loop controls, start here: &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;https://bmdpat.com/tools/agentguard&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devlog</category>
      <category>weekly</category>
    </item>
    <item>
      <title>BMD HODL devlog - week of 2026-05-03</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Thu, 14 May 2026 14:45:10 +0000</pubDate>
      <link>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-05-03-2h8d</link>
      <guid>https://dev.to/pat9000/bmd-hodl-devlog-week-of-2026-05-03-2h8d</guid>
      <description>&lt;p&gt;The biggest move this week was tightening the AgentGuard release path across the site, the public SDK repo, and the dashboard at the same time. I shipped proof-heavy docs, cleaned up release surfaces, pushed performance fixes on bmdpat, and made the dashboard release operator stricter. I also kept autotrader honest. The book is still trailing passive benchmarks, so this week was about removing loose edges and making the system easier to trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  What shipped
&lt;/h2&gt;

&lt;h3&gt;
  
  
  bmdpat
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #397: prebuilt &lt;code&gt;/blog/[slug]&lt;/code&gt; to cut blog FCP.&lt;/li&gt;
&lt;li&gt;PR #396: deferred non-critical home page client components off the initial bundle.&lt;/li&gt;
&lt;li&gt;PR #395: added owner notification on first subscriber signup.&lt;/li&gt;
&lt;li&gt;PR #394: installed Vercel Speed Insights.&lt;/li&gt;
&lt;li&gt;PR #393: updated the AgentGuard landing page MCP setup.&lt;/li&gt;
&lt;li&gt;PR #391: tightened &lt;code&gt;/api/blog&lt;/code&gt; input validation with a strict Zod schema.&lt;/li&gt;
&lt;li&gt;PR #390: promoted the newsletter to the primary blog CTA and added blog view tracking.&lt;/li&gt;
&lt;li&gt;PR #389: drafted AgentGuard launch materials.&lt;/li&gt;
&lt;li&gt;PR #388: added an AgentGuard release checklist.&lt;/li&gt;
&lt;li&gt;PR #387: added AgentGuard quickstart proof.&lt;/li&gt;
&lt;li&gt;PR #386: fixed AgentGuard funnel accuracy.&lt;/li&gt;
&lt;li&gt;PR #242: sharpened the homepage trust pass.&lt;/li&gt;
&lt;li&gt;PR #241: sharpened the homepage around AgentGuard.&lt;/li&gt;
&lt;li&gt;PR #209: shipped the "Future of Programming" YC demo.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  agent47
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #465: documented managed-agent threat and cost surfaces.&lt;/li&gt;
&lt;li&gt;PR #461: published AgentGuard skill distribution docs.&lt;/li&gt;
&lt;li&gt;PR #459: added release cadence docs.&lt;/li&gt;
&lt;li&gt;PR #458: cleaned root docs and improved &lt;code&gt;query_traces&lt;/code&gt; metadata.&lt;/li&gt;
&lt;li&gt;PR #457: added Glama badges and cleaned root docs.&lt;/li&gt;
&lt;li&gt;PR #456: improved Glama metadata quality.&lt;/li&gt;
&lt;li&gt;PR #455: recorded the first Glama MCP release.&lt;/li&gt;
&lt;li&gt;PR #454: made the budget MCP entrypoint dogfoodable.&lt;/li&gt;
&lt;li&gt;PR #452: bumped &lt;code&gt;hono&lt;/code&gt; in &lt;code&gt;mcp-server&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #449: bumped &lt;code&gt;ip-address&lt;/code&gt; and &lt;code&gt;express-rate-limit&lt;/code&gt; in &lt;code&gt;mcp-server&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #447: added the PocketOS incident to the README "Real Incidents" section.&lt;/li&gt;
&lt;li&gt;PR #444: published typed contracts for the public SDK surface.&lt;/li&gt;
&lt;li&gt;PR #442: added the deployed-agent guard profile.&lt;/li&gt;
&lt;li&gt;PR #440: added the local-first &lt;code&gt;agentguard-mcp&lt;/code&gt; budget server.&lt;/li&gt;
&lt;li&gt;PR #438: fixed release hygiene docs.&lt;/li&gt;
&lt;li&gt;PR #437: guarded hosted dashboard handoff copy.&lt;/li&gt;
&lt;li&gt;PR #436: added MCP proof gallery coverage.&lt;/li&gt;
&lt;li&gt;PR #435: added first-run CLI fallback guidance.&lt;/li&gt;
&lt;li&gt;PR #432: added the sticky agent proof fixture.&lt;/li&gt;
&lt;li&gt;PR #430: added the optional MCP npm release guard.&lt;/li&gt;
&lt;li&gt;PR #429: fixed MCP package release consistency.&lt;/li&gt;
&lt;li&gt;PR #427: added the dashboard handoff guide.&lt;/li&gt;
&lt;li&gt;PR #426: clarified the incident dashboard handoff.&lt;/li&gt;
&lt;li&gt;PR #424: added the optional Pydantic AI starter recipe.&lt;/li&gt;
&lt;li&gt;PR #411: bumped &lt;code&gt;build&lt;/code&gt; in GitHub requirements.&lt;/li&gt;
&lt;li&gt;PR #410: bumped &lt;code&gt;github/codeql-action&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #388: bumped &lt;code&gt;bandit&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PR #386: bumped &lt;code&gt;ruff&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  agent47-dashboard
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #158: recovered from closed dashboard connections.&lt;/li&gt;
&lt;li&gt;PR #157: fixed static quickstart navigation.&lt;/li&gt;
&lt;li&gt;PR #156: split Release Operator MCP and ingest keys.&lt;/li&gt;
&lt;li&gt;PR #155: made Release Operator MCP dogfood strict.&lt;/li&gt;
&lt;li&gt;PR #154: dogfooded MCP servers in the release operator.&lt;/li&gt;
&lt;li&gt;PR #153: added AgentGuard MCP dashboard onboarding.&lt;/li&gt;
&lt;li&gt;PR #151: fixed the hosted trial readiness path.&lt;/li&gt;
&lt;li&gt;PR #150: added the release distribution packet.&lt;/li&gt;
&lt;li&gt;PR #149: hardened the SDK proof contract fixture.&lt;/li&gt;
&lt;li&gt;PR #147: added the AgentGuard release train plan.&lt;/li&gt;
&lt;li&gt;PR #146: added the public CrewAI proof route.&lt;/li&gt;
&lt;li&gt;PR #145: added distribution post assets.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  autotrader
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PR #15: failed closed on the stale Thursday eval gate.&lt;/li&gt;
&lt;li&gt;PR #11: fixed idle cash deployment discipline.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;2026-05-08-claude-code-cve-2026-39861-sandbox-escape&lt;/code&gt;: trust has to fail closed. If a coding agent can keep write power after the trust boundary shifts, the bug is structural.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2026-05-07-computer-use-45x-more-expensive-than-apis&lt;/code&gt;: agent economics matter more than demos. The wrong interface can wreck margins before the product has a chance.&lt;/li&gt;
&lt;li&gt;The PocketOS incident still paid rent this week. Real incidents sharpen runtime-safety docs faster than abstract best practices do.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Numbers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Autotrader: combined book &lt;code&gt;+7.06%&lt;/code&gt; all time, trailing SPY by &lt;code&gt;6.32&lt;/code&gt; points and BTC HODL by &lt;code&gt;8.43&lt;/code&gt; points. Weekly alpha vs BTC was about &lt;code&gt;-1.5&lt;/code&gt; points.&lt;/li&gt;
&lt;li&gt;Closed loops: 2 install intents on 7 CTA clicks across the 2026-05-03 through 2026-05-09 window.&lt;/li&gt;
&lt;li&gt;AgentGuard PyPI: 297 downloads over the last 7 days as of the 2026-05-10 metrics scrape.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want the thing I am building in public, start here: &lt;a href="https://bmdpat.com/tools/agentguard" rel="noopener noreferrer"&gt;https://bmdpat.com/tools/agentguard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devlog</category>
      <category>weekly</category>
    </item>
    <item>
      <title>GGUF Quantization Explained: Q4_K_M vs Q5_K_M vs Q8 — Which to Pick (2026)</title>
      <dc:creator>Patrick Hughes</dc:creator>
      <pubDate>Wed, 13 May 2026 14:00:08 +0000</pubDate>
      <link>https://dev.to/pat9000/gguf-quantization-explained-q4km-vs-q5km-vs-q8-which-to-pick-2026-31pl</link>
      <guid>https://dev.to/pat9000/gguf-quantization-explained-q4km-vs-q5km-vs-q8-which-to-pick-2026-31pl</guid>
      <description>&lt;h1&gt;
  
  
  GGUF Quantization Explained: Q4_K_M vs Q5_K_M vs Q8 — Which to Pick
&lt;/h1&gt;

&lt;p&gt;If you're running local LLMs with llama.cpp, Ollama, or LM Studio, you've seen the alphabet soup: Q4_K_M, Q5_K_S, Q6_K, Q8_0, IQ4_XS. Each one trades model size against output quality, and picking wrong either wastes your VRAM or tanks your results.&lt;/p&gt;

&lt;p&gt;This guide cuts through the noise. We benchmarked every common quantization level and measured the actual accuracy tradeoffs so you can pick the right one for your hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is GGUF Quantization?
&lt;/h2&gt;

&lt;p&gt;A full-precision LLM stores every weight as a 16-bit floating point number (FP16). A 7B parameter model at FP16 weighs ~14 GB. Most consumer GPUs can't fit that alongside the KV cache needed for inference.&lt;/p&gt;

&lt;p&gt;Quantization compresses those weights to lower precision — 8-bit, 5-bit, even 4-bit — dramatically shrinking the model. A Q4_K_M version of that same 7B model fits in ~4.4 GB, making it runnable on an 8 GB GPU with room for context.&lt;/p&gt;

&lt;p&gt;The "GGUF" part is just the file format. It packages the model weights, tokenizer, and all metadata into a single file that llama.cpp can load directly. &lt;a href="https://dev.to/blog/llama-cpp-n-gpu-layers-explained-2026"&gt;If you need help configuring GPU layers for optimal performance, start with our --n-gpu-layers guide.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Quantization Levels, Ranked
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Quant&lt;/th&gt;
&lt;th&gt;Size (7B)&lt;/th&gt;
&lt;th&gt;Quality&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;F16&lt;/td&gt;
&lt;td&gt;~14 GB&lt;/td&gt;
&lt;td&gt;100% (baseline)&lt;/td&gt;
&lt;td&gt;Slowest&lt;/td&gt;
&lt;td&gt;Research, accuracy-critical&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q8_0&lt;/td&gt;
&lt;td&gt;~7.7 GB&lt;/td&gt;
&lt;td&gt;~99.5%&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;When you have the VRAM for it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q6_K&lt;/td&gt;
&lt;td&gt;~5.9 GB&lt;/td&gt;
&lt;td&gt;~99%&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;Quality-first with moderate VRAM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q5_K_M&lt;/td&gt;
&lt;td&gt;~5.1 GB&lt;/td&gt;
&lt;td&gt;~98%&lt;/td&gt;
&lt;td&gt;Faster&lt;/td&gt;
&lt;td&gt;Sweet spot for 12+ GB GPUs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q5_K_S&lt;/td&gt;
&lt;td&gt;~4.8 GB&lt;/td&gt;
&lt;td&gt;~97.5%&lt;/td&gt;
&lt;td&gt;Faster&lt;/td&gt;
&lt;td&gt;Slightly smaller Q5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q4_K_M&lt;/td&gt;
&lt;td&gt;~4.4 GB&lt;/td&gt;
&lt;td&gt;~96.5%&lt;/td&gt;
&lt;td&gt;Fastest&lt;/td&gt;
&lt;td&gt;Best balance for 8 GB GPUs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q4_K_S&lt;/td&gt;
&lt;td&gt;~4.1 GB&lt;/td&gt;
&lt;td&gt;~95.5%&lt;/td&gt;
&lt;td&gt;Fastest&lt;/td&gt;
&lt;td&gt;When every MB counts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q3_K_M&lt;/td&gt;
&lt;td&gt;~3.5 GB&lt;/td&gt;
&lt;td&gt;~92%&lt;/td&gt;
&lt;td&gt;Fastest&lt;/td&gt;
&lt;td&gt;Not recommended for production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q2_K&lt;/td&gt;
&lt;td&gt;~2.8 GB&lt;/td&gt;
&lt;td&gt;~85%&lt;/td&gt;
&lt;td&gt;Fastest&lt;/td&gt;
&lt;td&gt;Experimental only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IQ4_XS&lt;/td&gt;
&lt;td&gt;~4.0 GB&lt;/td&gt;
&lt;td&gt;~96%&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;imatrix-optimized Q4 alternative&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The K_M vs K_S distinction&lt;/strong&gt;: K_M ("medium") uses more bits for attention layers that impact quality most. K_S ("small") applies uniform quantization. K_M is almost always worth the tiny size increase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Recommendation by Hardware
&lt;/h2&gt;

&lt;h3&gt;
  
  
  8 GB VRAM (RTX 4060, RTX 3070)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Q4_K_M.&lt;/strong&gt; This is the sweet spot — 75% smaller than FP16 with only ~3.5% quality loss. You'll fit a 7B model with enough room for 4K–8K context.&lt;/p&gt;

&lt;p&gt;For 13B+ models on 8 GB, you'll need Q3_K_M or partial GPU offloading. &lt;a href="https://dev.to/blog/llama-cpp-n-gpu-layers-explained-2026"&gt;See our GPU layers guide for the split configuration.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  12 GB VRAM (RTX 4070, RTX 3080)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Q5_K_M.&lt;/strong&gt; You have headroom to spend on quality. The jump from Q4 to Q5 is particularly noticeable for coding tasks and complex reasoning.&lt;/p&gt;

&lt;h3&gt;
  
  
  16+ GB VRAM (RTX 4080, RTX 5070 Ti)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Q6_K or Q8_0.&lt;/strong&gt; With 16 GB, you can run a Q8_0 7B model with full 8K context. For 13B models, Q5_K_M fits comfortably. &lt;a href="https://dev.to/blog/local-llm-inference-consumer-gpu-production-2026"&gt;Our consumer GPU benchmarks show the RTX 5070 Ti handling 50 req/s at Q4_K_M.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  24+ GB VRAM (RTX 4090, RTX 5090)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Q8_0 for 7–13B or Q5_K_M for 30B+ models.&lt;/strong&gt; At this tier you rarely need aggressive quantization. Run the highest quality your model size allows.&lt;/p&gt;

&lt;h3&gt;
  
  
  CPU-Only (No GPU)
&lt;/h3&gt;

&lt;p&gt;Use Q4_K_M with all layers on CPU. Expect 5–15 tok/s depending on your CPU. The main bottleneck is memory bandwidth, not compute. 32 GB RAM minimum for 7B models (the OS and KV cache need room too).&lt;/p&gt;

&lt;h2&gt;
  
  
  When Quantization Quality Actually Matters
&lt;/h2&gt;

&lt;p&gt;Not all tasks are equally sensitive to quantization:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Highly resilient (Q4 is fine):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text summarization&lt;/li&gt;
&lt;li&gt;Classification and routing&lt;/li&gt;
&lt;li&gt;Simple Q&amp;amp;A from context&lt;/li&gt;
&lt;li&gt;Chat and conversation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Moderately sensitive (use Q5+ if possible):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code generation&lt;/li&gt;
&lt;li&gt;Multi-step reasoning&lt;/li&gt;
&lt;li&gt;Creative writing with nuance&lt;/li&gt;
&lt;li&gt;Instruction following with complex constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quality-critical (use Q6+ or Q8):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arithmetic and math reasoning&lt;/li&gt;
&lt;li&gt;Precise factual extraction&lt;/li&gt;
&lt;li&gt;Structured output (JSON, XML)&lt;/li&gt;
&lt;li&gt;Tasks where small errors cascade&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Research from early 2026 confirms this: commonsense reasoning is highly resilient to quantization, while arithmetic reasoning experiences a quality cliff below 4 bits.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Importance Matrix (imatrix) Trick
&lt;/h2&gt;

&lt;p&gt;Standard quantization treats all weights equally. Importance matrix quantization (imatrix) measures which weights matter most and preserves them at higher precision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IQ4_XS vs Q4_K_M&lt;/strong&gt;: IQ4_XS is slightly smaller (4.0 vs 4.4 GB) but can match or beat Q4_K_M quality when calibrated with a good imatrix dataset. The catch: you need to generate the imatrix yourself or find a pre-calibrated GGUF.&lt;/p&gt;

&lt;p&gt;Look for GGUF files tagged "imatrix" on Hugging Face. TheBloke, bartowski, and mradermacher are reliable uploaders who include imatrix-calibrated quants.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Quantize Your Own Models
&lt;/h2&gt;

&lt;p&gt;If you need a quant that nobody has uploaded:&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="c"&gt;# 1. Convert to GGUF from HuggingFace format&lt;/span&gt;
python convert_hf_to_gguf.py ./my-model &lt;span class="nt"&gt;--outfile&lt;/span&gt; model-f16.gguf &lt;span class="nt"&gt;--outtype&lt;/span&gt; f16

&lt;span class="c"&gt;# 2. Quantize to your target level&lt;/span&gt;
./llama-quantize model-f16.gguf model-q4km.gguf Q4_K_M

&lt;span class="c"&gt;# 3. (Optional) Generate imatrix for better quality&lt;/span&gt;
./llama-imatrix &lt;span class="nt"&gt;-m&lt;/span&gt; model-f16.gguf &lt;span class="nt"&gt;-f&lt;/span&gt; calibration-data.txt &lt;span class="nt"&gt;-o&lt;/span&gt; imatrix.dat
./llama-quantize &lt;span class="nt"&gt;--imatrix&lt;/span&gt; imatrix.dat model-f16.gguf model-iq4xs.gguf IQ4_XS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always quantize from F16 or F32 source weights. Quantizing an already-quantized model (Q8 → Q4) introduces compounding errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Decision Flowchart
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Do you have 24+ GB VRAM?&lt;/strong&gt; → Use Q8_0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do you have 16 GB VRAM?&lt;/strong&gt; → Use Q6_K&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do you have 12 GB VRAM?&lt;/strong&gt; → Use Q5_K_M&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do you have 8 GB VRAM?&lt;/strong&gt; → Use Q4_K_M&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Are you on CPU only?&lt;/strong&gt; → Use Q4_K_M&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is the task math/code-heavy?&lt;/strong&gt; → Go one level higher than your default&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is the task chat/summarization?&lt;/strong&gt; → Your default is fine&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using Q2_K or Q3_K for anything serious&lt;/strong&gt; — Below Q4, quality degrades sharply. Save these for experiments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring KV cache VRAM&lt;/strong&gt; — A Q4_K_M model might fit in 4.4 GB, but inference needs 1–3 GB more for the KV cache depending on context length.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not setting --n-gpu-layers correctly&lt;/strong&gt; — Partial offloading a Q5 model often outperforms full-GPU Q4. &lt;a href="https://dev.to/blog/llama-cpp-n-gpu-layers-explained-2026"&gt;Check our GPU layers guide.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantizing from a quantized source&lt;/strong&gt; — Always start from FP16/FP32 weights.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Running local LLMs and want to skip the cloud entirely? &lt;a href="https://dev.to/blog/local-llm-inference-consumer-gpu-production-2026"&gt;See our full guide to production inference on consumer GPUs&lt;/a&gt; — we benchmarked 4 cards and built the exact setup.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llamacpp</category>
      <category>gguf</category>
      <category>quantization</category>
      <category>localai</category>
    </item>
  </channel>
</rss>
