<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jason Williams on Medium]]></title>
        <description><![CDATA[Stories by Jason Williams on Medium]]></description>
        <link>https://medium.com/@jwill9999?source=rss-4a7d8d02ec85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*knebuBqjMvL5O5LmMs64ag@2x.jpeg</url>
            <title>Stories by Jason Williams on Medium</title>
            <link>https://medium.com/@jwill9999?source=rss-4a7d8d02ec85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:08:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jwill9999/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The AI Subscription Model Is Cracking as Tokenomics Takes Over]]></title>
            <link>https://medium.com/@jwill9999/the-ai-subscription-model-is-cracking-as-tokenomics-takes-over-fd8bf38aa161?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd8bf38aa161</guid>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 20:08:16 GMT</pubDate>
            <atom:updated>2026-11-02T00:03:21.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B31gcnRQivd4an0HR6bZxA.png" /><figcaption>Broken AI token subscription model, AI-generated with OpenAI Codex.</figcaption></figure><p>GitHub Copilot’s switch to usage-based billing shows what agent workloads really cost to run.</p><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><p>In recent years, most AI tools have followed a simple model. Users pay a monthly subscription to access advanced features, and providers oversee the technical details behind the scenes.</p><p>Now, this model is starting to show strain across the industry.</p><p>One clear example is GitHub’s recent announcement. Starting<strong> June 1, 2026</strong>, GitHub Copilot will switch to usage-based billing with AI credits. Instead of vague ‘premium requests,’ pricing will depend on actual token use, including input, output, and cached tokens, to better reflect real model costs.</p><p>This change exceeds being merely a new pricing method. It signals a larger shift in how people use and pay for AI.</p><h3>TL;DR</h3><ul><li>The idea of unlimited AI subscriptions is being challenged as computing demands grow.</li><li>Agent-based workflows use far more tokens than regular chat, which exposes the real costs of running the infrastructure.</li><li>Providers are adopting tokenomics to remain sustainable.</li><li>Subscriptions are evolving into managed plans with clear limits.</li><li>Developers are paying closer attention to costs and optimising their model, context, and agent design choices. Practical steps include prompt engineering to reduce unnecessary output, batching tasks to increase efficiency, and managing context windows to avoid processing excess data. By applying these strategies, developers can immediately reduce token usage and make their AI workflows more cost-effective.</li><li>Lower-cost models like DeepSeek are putting pressure on market prices.</li><li>Future AI competition will focus on capability and value for money.</li></ul><h3>The Breaking Point: Agents Change the Economics</h3><p>The first subscription model worked well because usage was easy to predict. Most users generated text, summarised documents, or accepted code suggestions. Previously, providers were able to balance demand among millions of users and maintain healthy profit margins. However, according to a report from Simon-Kucher &amp; Partners, AI agents are changing this dynamic by autonomously resolving a large share of IT support requests and reducing seat-based licensing costs by up to 50 percent.</p><p>Agents go beyond answering single prompts. They read files, check repositories, use tools, write and run code, retry failed steps, compress context, and connect multiple models. These workflows can last several minutes or more and use many more tokens than regular chat.</p><p>This creates a different cost structure.</p><p>The industry is facing a reality check. Users want smarter agents, bigger context windows, and access to advanced models, but providing these features is expensive. Compute, infrastructure, and energy are now at the heart of every engagement.</p><p>User behaviour is changing too. Developers are shifting from simple AI interactions to letting these systems handle more important tasks.</p><h3>Subscriptions Aren’t Dead — But They Are Changing</h3><p>Some may see this as the end of subscriptions, but that is not the case.</p><p>For people who use AI a lot, subscriptions can still be a better deal than paying per token.</p><p>Token pricing makes users more cost-conscious, reducing experimentation. To encourage safe innovation without unexpected costs, providers can offer sandbox environments or allocate capped test credits for developers. These approaches let users experiment and iterate on new ideas while protecting them from accidental overspending, helping to maintain a healthy pace of experimentation and improvement.</p><p>According to ITPro, AWS executives have noted that software developers are seeing significant productivity gains by using AI tools such as the Kiro coding agent. Bundled solutions are still a favoured option among developers.</p><p>Providers like Anthropic (Claude tiers), Cursor AI (with different model access levels), and Poe by Quora are taking a similar approach. They package multiple models together, set usage limits, and simplify the user experience.</p><p>The main selling point is changing:</p><ul><li><strong>Old model:</strong> Pay once, use freely</li><li><strong>New model:</strong> Pay for managed access, defined limits, and convenience</li></ul><p>This change is subtle but important for the industry.</p><h3>Tokenomics Is Changing Developer Behaviour</h3><p>When usage is tied directly to tokens, people change how they use AI.</p><p>Developers now concentrate on efficiency — choosing models that are “good enough” for each task.</p><ul><li>When should I use a frontier model versus a cheaper one?</li><li>How much context is actually necessary?</li><li>Is my agent wasting tokens through poor orchestration?</li></ul><p>At this stage, tokenomics shapes system design, not just pricing.</p><p>People are increasingly using a mix of models for different tasks. Advanced models handle intricate reasoning, cheaper ones do routine coding, local models keep data safe, and a routing layer manages them all. Effective routing strategies are key to maximising efficiency: these systems typically decide which model to use based on task complexity, cost, response time, or data sensitivity. For example, a routing layer might send simple code completions to a lightweight model for speed, reserve advanced models for complex analysis, or direct sensitive workloads to local models for privacy. Some solutions also factor in latency requirements or dynamically adjust model choices based on current usage patterns. By outlining clear decision criteria, developers can design multi-model systems that balance performance and cost for each workflow.</p><p>In this setup, agent design is a major cost factor. Well-designed agents get better results for less.</p><h3>Pricing Pressure Is Coming From Below</h3><p>Cheaper models are speeding up this change.</p><p>DeepSeek is a good example of this trend. Its low prices, discounts, and cheaper cache costs are making the market rethink what ‘premium’ means. According to a report from tech.yahoo.com, DeepSeek has released a preview of its V4 large language model, which features 1.6 trillion parameters and a 1 million token context window, making it the company’s most powerful model to date. According to IBM, as AI becomes more affordable and less expensive models are able to perform most real-world tasks, it no longer makes sense to use the most advanced model at every stage. High-end models will still have a place but their role in the overall process is likely to shift as costs decrease. They become special tools for the hardest problems, not the default option.</p><h3>The Geopolitical Layer</h3><p>A bigger strategic picture is also coming into view.</p><p>Models like DeepSeek V4, built for other hardware, show that global AI infrastructure is diverging. Limits on advanced chips changed development patterns, not progress.</p><p>This puts pressure on markets like the United States. Being ahead now means more than just building better models. It also requires strong energy supplies, chip manufacturing, data centre capacity, and national-level investment.</p><p>People are starting to see AI as part of core infrastructure, not just another type of software. (AI Infrastructure Market Size, Share &amp; Growth Report, 2030, 2023)</p><h3>Energy, Compute, and the Real Cost of Intelligence</h3><p>Each token requires real hardware, such as GPUs and electricity. (Alexander, 2025) Data centres are major electricity users as AI demand grows. (Inc., 2025) As energy demands rise, developers and providers can help by exploring practices such as model distillation to create more efficient models, deploying solutions on hardware that matches the workload, and adopting green data centres powered by renewable energy. These steps enable reducing the energy and financial costs of AI at scale while supporting sustainability.</p><p>This changes how companies need to optimise their systems.</p><p>The industry must reduce the cost per unit of useful intelligence to grow.</p><p>This means innovation is needed at several levels:</p><ul><li><strong>Model layer:</strong> more efficient architectures, mixture-of-experts, distillation</li><li><strong>Runtime layer:</strong> smarter inference, caching, batching, routing</li><li><strong>Agent layer:</strong> disciplined orchestration, avoiding unnecessary loops and context bloat</li></ul><p>Tokenomics is now essential to system design, not just pricing.</p><h3>A Hybrid Future</h3><p>So what does this mean for the industry going forward?</p><p>Subscriptions will continue, but offering ‘unlimited’ access is harder to justify.</p><p>A mix of models is the most likely result:</p><ul><li>Subscriptions for predictable, human-facing workflows</li><li>Token-based pricing for expandable, productised systems</li><li>Internal routing layers to manage cost, performance, and governance</li></ul><p>Users will care more about costs, developers will concentrate on efficiency, providers must be transparent, and models compete on performance and cost. To support this, teams are increasingly turning to transparency and monitoring tools that track token usage, spending, and model activity. Providers are beginning to offer dashboards, usage reports, and alerts that help developers maintain visibility and control over costs. Metrics such as total tokens used, cost per workflow, and token distribution by agent or model provide actionable insights, enabling teams to quickly identify inefficiencies and keep expenses in check.</p><h3>The Real Shift</h3><p>The main question is changing.</p><p>It is no longer simply:</p><p><strong>Which model is best?</strong></p><p>It is becoming:</p><p><strong>Which model is best for this task, at this cost, within this workflow?</strong></p><p>That is the real change happening now.</p><p>According to a KuCoin report, DeepSeek has introduced its new V4 series of models, including the V4-Pro with 1.6 trillion parameters, as AI infrastructure continues to advance. The report notes that these models are designed to handle greater user demand and computational realities and are available with features such as a 1-million-token context window. As these developments reshape what AI companies offer, tokenomics is expected to play a significant role in the next phase of AI.</p><h3>Conclusion</h3><p>The AI subscription model isn’t collapsing, but perspectives are changing. Unlimited access was always simplistic. According to Keito Team, as AI evolves toward agent-based tasks, the highest costs include tokens, inference compute, embeddings and vector storage, API calls, fine-tuning, and monitoring. What comes next is not a complete replacement, but rather an adaptation.</p><p>Subscriptions remain for predictability; token pricing expands where optimisation matters. Most use both with internal routing. Lower-cost models and infrastructure pressures intensify competition.</p><p>The result is a market that is more mature and resilient.</p><p>It is a market where effectiveness matters just as much as advanced features.<br>Agent design now rivals model choice in importance. The big question has changed: it’s about effective paths to the desired outcome.</p><p><strong>References</strong></p><p>Kelly, R. (July 29, 2025). 84% of software developers are now using AI, but nearly half ‘don’t trust’ the technology over accuracy concerns. IT Pro. <a href="https://www.itpro.com/software/development/developers-arent-quite-ready-to-place-their-trust-in-ai-nearly-half-say-they-dont-trust-the-accuracy-of-outputs-and-end-up-wasting-time-debugging-code">https://www.itpro.com/software/development/developers-arent-quite-ready-to-place-their-trust-in-ai-nearly-half-say-they-dont-trust-the-accuracy-of-outputs-and-end-up-wasting-time-debugging-code</a></p><p>(April 26, 2026). DeepSeek launches 1.6 trillion parameter V4 on Huawei chips as U.S. escalates AI theft accusations. Tom’s Hardware. <a href="https://www.tomshardware.com/tech-industry/artificial-intelligence/deepseek-launches-1-6-trillion-parameter-v4-on-huawei-chips-as-us-escalates-ai-theft-accusations">https://www.tomshardware.com/tech-industry/artificial-intelligence/deepseek-launches-1-6-trillion-parameter-v4-on-huawei-chips-as-us-escalates-ai-theft-accusations</a></p><p>(2023). AI Infrastructure Market Size, Share &amp;amp; Growth Report, 2030. Grand View Research. <a href="https://www.grandviewresearch.com/industry-analysis/ai-infrastructure-market-report">https://www.grandviewresearch.com/industry-analysis/ai-infrastructure-market-report</a></p><p>Alexander, A. (November 13, 2025). OpenAI’s colossal AI data center targets would consume as much electricity as entire nation of India. Tom’s Hardware. <a href="https://www.tomshardware.com/tech-industry/artificial-intelligence/openais-colossal-ai-data-center-targets-would-consume-as-much-electricity-as-entire-nation-of-india-250gw-target-would-require-30-million-gpus-annually-to-ensure-continuous-operation-emit-twice-as-much-carbon-dioxide-as-exxonmobil">https://www.tomshardware.com/tech-industry/artificial-intelligence/openais-colossal-ai-data-center-targets-would-consume-as-much-electricity-as-entire-nation-of-india-250gw-target-would-require-30-million-gpus-annually-to-ensure-continuous-operation-emit-twice-as-much-carbon-dioxide-as-exxonmobil</a></p><p>Inc., G. (November 17, 2025). Gartner Says Electricity Demand for Data Centers to Grow 16% in 2025 and Double by 2030. Gartner. <a href="https://www.gartner.com/en/newsroom/press-releases/gartner-says-electricity-demand-for-data-centers-to-grow-16-percent-in-2025-and-double-by-2030">https://www.gartner.com/en/newsroom/press-releases/gartner-says-electricity-demand-for-data-centers-to-grow-16-percent-in-2025-and-double-by-2030</a></p><p>CPA, L. F. (2025). AI Subscription vs Token Costs: CFO Budget Reality Guide. CFO Charm. <a href="https://www.cfocharm.com/insights/ai-subscriptions-vs-tokens-cost-paradox">https://www.cfocharm.com/insights/ai-subscriptions-vs-tokens-cost-paradox</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd8bf38aa161" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing Production-Ready AI Systems: What Software Engineers Need to Know]]></title>
            <link>https://medium.com/@jwill9999/designing-production-ready-ai-systems-what-software-engineers-need-to-know-37300f62a423?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/37300f62a423</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 13:06:21 GMT</pubDate>
            <atom:updated>2026-11-02T00:02:22.507Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXEvIfpELOTbAahOd9HLkw.png" /><figcaption>Designing a production-ready AI system, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>Production AI is a systems-design problem, not a prompting one. Here’s how to separate the layers.</p><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><p>Building an AI-enabled system for production is not chiefly a prompting problem. It is a systems design problem. The hard part is not persuading a model to produce an impressive answer in a controlled demo, but designing an environment in which that answer can be trusted, bounded, observed and governed. Once AI moves beyond experimentation and begins to influence business processes, customer journeys or operational decisions, the engineering questions become far more familiar: where responsibilities sit, how contracts are enforced, how failures are contained, and how change can be introduced without destabilising the whole.</p><p>This is why production AI systems should be approached in much the same way as other distributed systems. They require separation of concerns, explicit interfaces, reliable observability, and carefully drawn control boundaries. The difference is that AI introduces an additional source of variability. Models are probabilistic, context windows are limited, tool use can become expensive, and unsafe behaviour may emerge from weak boundaries rather than faulty code alone. A production-ready AI system, therefore, needs more than a model and a set of prompts. It needs a deliberate architecture.</p><p>A practical way to understand that architecture is to think in layers. At the centre sits the model, but the model is only one component in a broader system. Around it are the runtime that manages execution, the tooling layer that exposes controlled capabilities, the services and data layer that holds the real business logic, and the harness that governs access, permissions, policy and audit. Supporting all of these are cross-cutting concerns such as cost control, security, performance and operational monitoring. When these layers are cleanly separated, systems remain testable, adaptable and easier to evolve. When they are blended together, complexity rises quickly, and operational confidence falls just as fast.</p><h3>From prototype to production</h3><p>Most teams do not begin with a full architectural stack, nor should they. Early work is usually exploratory. A model is connected to a simple user interface or command line, some inline logic is added, and a few tools or API calls are wired in to test whether the use case has any value at all. At this stage, speed matters more than elegance. The aim is to prove that the underlying task is feasible. Can the model reason usefully about the problem? Can it call a tool successfully? Can it produce results that justify further investment? For that purpose, a loosely structured prototype is entirely reasonable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3TffNg4d-Gg9fN6eL25BMQ.png" /><figcaption>AI from prototype to production: The 5-layer architecture, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>The problem comes when a prototype is mistaken for a production design. A prototype often concentrates decision-making, orchestration, prompt construction and integration logic in one place. That is acceptable while risk is low and change is frequent. It becomes a liability once the system needs stable behaviour, traceability or security guarantees. What began as a quick way to validate capability turns into a fragile, tangled execution path that is difficult to test and even harder to trust.</p><p>The first meaningful architectural step is to introduce a basic runtime layer. This marks the transition from “model with helper code” to “system with an execution engine”. In a structured MVP, the runtime becomes responsible for assembling context, invoking the model, choosing tools and shaping the response. Tools are separated into explicit interfaces rather than scattered logic branches, and core business behaviour remains inside services rather than drifting into the AI layer. This is the point at which the system stops being a demo and becomes an engineering asset.</p><p>From there, the next step is not more intelligence, but more control. A transitional architecture introduces a harness around the runtime. Authentication, logging, traceability and policy begin to sit outside execution rather than inside it. Tool contracts become more explicit, identity becomes clearer, and the system acquires an outer boundary that can be reasoned about independently of model behaviour. For many teams, this is the stage at which stability should be achieved before adding further sophistication.</p><p>A production system goes further still. It formalises the harness, hardens the runtime, constrains the tooling layer and preserves the service and data layers as the authoritative source of truth. At this stage, permissioning, audit trails, policy enforcement, memory strategies, retrieval optimisation, cost controls and operational diagnostics are no longer optional enhancements. They are part of the architecture itself.</p><h3>The harness as the control plane</h3><p>The harness is best understood as the control plane of the system — functioning much like an API Gateway or advanced middleware [7]. It is the outer boundary through which requests enter, and responses leave. Its role is not to decide how a payment should be created, how an account should be updated, or how a recommendation should be ranked. Its role is to control who is allowed to ask, under what conditions, with which permissions, and with what degree of visibility into the resulting behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U03JF3P3P-zQgOlOlf7Dsw.png" /><figcaption>The AI Harness, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>In practical terms, the harness is responsible for identity, authentication, permission checks, policy evaluation, request lifecycle control, audit logging and rate limiting. Crucially, the harness defines which actions require approval, who is permitted to approve them, and how those decisions are recorded for audit. It should also be the place where other cross-cutting governance concerns sit: approval flows for sensitive actions, tracing for high-risk operations, and operational controls such as throttling or session boundaries.</p><p>These are not concerns that the runtime should own. If the execution engine both performs work and decides the limits of that work, the system loses a meaningful control boundary. This distinction matters because AI systems are, by design, capable of making dynamic choices. That flexibility is useful, but it means that control needs to sit outside the component, making the choice. A harness creates that separation, ensuring that the system has an independent layer capable of constraining behaviour before execution begins and recording it after execution ends.</p><h3>The runtime as the execution engine</h3><p>If the harness governs the system, the runtime drives it. The runtime is the execution engine responsible for turning an incoming request into a structured interaction with a model and, where necessary, a set of tools. It assembles context, manages state for the current operation, invokes the model, interprets outputs, chooses whether tools should be called, and shapes the final response [3].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zp4e-zWBtrhkKk6CnZ7kYg.png" /><figcaption>The AI runtime, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>This is where much of the engineering complexity tends to accumulate, which is why restraint is important. The runtime must orchestrate, but it should remain generic. It should not become a second business layer, nor should it contain direct domain rules that properly belong in services. Its strength lies in managing flow rather than deciding truth.</p><p>To manage that flow safely, the runtime must do more than blindly trust model output. Provider guidelines consistently note that while structured output features can reduce formatting errors, AI agents remain fundamentally non-deterministic. The runtime should therefore validate model output structurally before treating it as executable intent. In production systems, model responses must be parsed against an expected schema, checked against the allowlisted tool catalogue, and rejected if they are malformed, incomplete or refer to non-existent capabilities. The runtime should distinguish between infrastructure failures and model-shape failures, because broken JSON, invalid tool arguments and repeated non-compliant outputs are orchestration errors, not ordinary service exceptions.</p><p>When validation fails, the runtime should not continue optimistically. It should apply a bounded recovery strategy: request one structured retry where appropriate, terminate on repeated schema violations, cap tool-call depth or iteration count to avoid loops, and return a safe failure state for logging, review or human intervention. The goal is not to force the model to continue at all costs, but to fail predictably when the output cannot be trusted. Structured output features from model providers can reduce formatting errors, but the runtime must still verify conformance, enforce tool allowlists, and stop execution when the model’s response is syntactically valid yet operationally unsafe.</p><p>Beyond validation, the runtime must handle the reality of time. In production systems, the runtime should support both synchronous and asynchronous execution paths. Low-risk operations may complete within a single request-response cycle, but high-impact or long-running tasks should be handled as durable workflows. Where human approval is required, the runtime should persist state in a database or durable workflow engine, emit an approval event, and suspend execution until an authorised decision is received [9]. The workflow then resumes from a known checkpoint rather than restarting the entire interaction. This allows the system to support Human-in-the-Loop controls without coupling approval logic to individual tools.</p><h3>The tooling layer as the capability boundary</h3><p>Between runtime and services sits the tooling layer. This is the capability boundary of the system: the controlled set of actions that the runtime is allowed to invoke. A tool is not just a convenient wrapper around an API call. It is an explicit contract describing what the AI system may do, how inputs are validated, and what shape outputs will take [4].</p><p>That contract is essential. Without it, the runtime is tempted to reach directly into services or databases, which erodes security, testability and flexibility. With it, capabilities can be exposed in a stable and governed manner. A tool might represent operations such as creating a payment, retrieving a customer profile, initiating a document search or scheduling an approval request. In each case, the tool provides a controlled interface rather than unrestricted access.</p><p>From an engineering perspective, tools should validate input rigorously, normalise output predictably, and remain thin relative to business rules. They are not the place for domain policy to accumulate, nor should they act as long-lived process managers waiting for human approval. Their purpose is to expose capability safely and consistently, acting as the contractual bridge between orchestration and the underlying system of record.</p><p>This matters because the tooling layer defines the practical limits of agentic behaviour. An AI system can only take actions that the tooling layer makes available. In that sense, tools are not merely utilities. They are the operational definition of what the system is permitted to do.</p><h3>Services and data as the source of truth</h3><p>Beneath the tooling layer sit the services and data that already underpin the wider application landscape. These may be microservices, internal APIs, workflow engines, external integrations or database-backed domain services [6]. Whatever form they take, their purpose is unchanged by the introduction of AI. They remain responsible for business rules, validation, data integrity and the protection of core invariants.</p><p>This point is easy to overlook when teams become enthusiastic about AI orchestration. There is often a temptation to shift logic upwards into prompts or runtime flows because it appears faster. In reality, this weakens the architecture. Business correctness should not depend on a model’s interpretation of instructions. It should be enforced where the domain is already understood and controlled.</p><p>The services and data layer must therefore remain independent of the runtime. The runtime is a client of the domain, not its owner. It may compose requests intelligently, but it should never become the place where truth is defined. If a payment limit exists, the service should enforce it. If a record must satisfy a validation rule, the service should reject invalid input regardless of what the model attempted. This separation is one of the clearest indicators that a team is building a production system rather than a persuasive demonstration.</p><h3>How the layers work together</h3><p>Once these layers are separated, the end-to-end flow becomes easier to reason about [10]. A user request enters through the harness, where identity, policy and logging are applied. The request is then passed to the runtime, which assembles the context and determines the next execution step. The model may respond directly or indicate that a tool should be used. If a tool is invoked, it passes through a controlled contract into the appropriate service, which in turn interacts with the underlying data or external system. The response then returns through the same chain in reverse, carrying with it the observability, control and validation imposed at each layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aINkAmijnAUjKJtlNa2gpg.png" /><figcaption>The AI Flow, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>The crucial rule is that the runtime should not access the database directly. It should not bypass the tooling layer, nor reimplement service logic simply because it can. The proper flow is runtime to tool, tool to service, service to data. That discipline preserves the system&#39;s modularity and makes each part independently testable and replaceable.</p><p>A useful mental model is this:</p><ul><li>The <strong>harness</strong> answers: <em>Are you allowed to do this, and is approval required?</em></li><li>The <strong>runtime</strong> answers: <em>What is structurally valid, and what should happen next?</em></li><li>The <strong>tool</strong> answers: <em>Which controlled action can be taken?</em></li><li>The <strong>service</strong> answers: <em>What is valid and correct?</em></li><li>The <strong>data layer</strong> answers: <em>What is true?</em></li></ul><p>When those answers start to blur together, the design usually needs to be reconsidered.</p><h3>Decoupling through interfaces</h3><p>A layered architecture only remains effective if the boundaries between layers are real rather than rhetorical. That is why interfaces matter. Without them, systems tend to collapse back into direct coupling, where orchestration code depends on infrastructure details and business logic seeps into every level. With well-defined interfaces, however, behaviour can remain stable even as implementations change.</p><p>For example, a payment capability should depend on a service contract rather than a specific storage engine or provider SDK. The runtime should be able to call a payment tool without needing any knowledge of whether the underlying implementation uses one payment platform or another. Similarly, services should be mockable in tests, replaceable in different environments and shielded from orchestration concerns.</p><p>This becomes particularly important in AI systems because provider choice, retrieval strategy and execution patterns often change faster than the domain itself. Interfaces allow those areas to evolve independently. They also make it possible to introduce configuration rather than rewriting logic whenever a provider, adapter or policy needs to be replaced.</p><h3>Security in production AI systems</h3><p>Security in AI systems is often discussed in abstract terms, but the practical requirements are architectural. Prompt injection, data leakage and uncontrolled tool execution are all symptoms of weak boundaries. They are not solved by better prompts alone.</p><p>As highlighted by frameworks such as the OWASP Top 10 for Large Language Model Applications [1], prompt injection is best understood as untrusted input attempting to influence system behaviour beyond its intended scope. The defence is not to assume the model will always resist it [8], but to ensure that the model&#39;s outputs are treated as proposals rather than as authority. Tool inputs must be validated. Permissions must be enforced independently. Sensitive actions should require explicit checks outside model reasoning.</p><p>Data leakage presents a different challenge. AI systems are often hungry for context, but context carries cost and risk. If sensitive information is casually included in prompts, exposure becomes difficult to control. The runtime, therefore, needs deliberate filtering and scoping, while service-level controls must continue to enforce what data may be retrieved in the first place. The presence of a model does not remove the need for least privilege; it strengthens the case for it.</p><p>Uncontrolled tool execution is perhaps the most operationally dangerous failure mode. If a model can call unsafe actions without robust allowlisting, validation, and permission checks, then the system has effectively blurred the distinction between intention and authority. The tooling layer and harness must prevent this. A model may suggest an action, but the architecture must decide whether that action is permitted.</p><h3>Performance and cost as first-class concerns</h3><p>Production AI systems do not merely need to work; they need to work efficiently. Cost can rise quickly through oversized prompts, repeated retrieval, excessive model calls and poorly scoped context assembly. Performance can degrade due to unnecessary orchestration loops, slow tool invocation, and indiscriminate use of memory or search layers.</p><p>The first response should be context discipline. Not every piece of available information belongs in every request. Context should be prioritised, deduplicated and constrained to what materially helps execution. More tokens do not automatically yield better results; they often lead to higher costs and greater ambiguity.</p><p>Caching also becomes important, though it must be applied carefully. Retrieval results can often be cached when the source data changes infrequently. Tool responses for stable lookups may also be cached where correctness allows it. Model output caching is possible in some cases, but it requires greater caution because subtle differences in prompts can matter. The aim is not blind optimisation, but deliberate reduction of waste.</p><p>A further principle is to reduce unnecessary model hops. Systems that repeatedly alternate between model and tool, then back to model, and then back to tool again, can become both expensive and slow. Where a direct tool response is sufficient, the architecture should allow it. Not every step requires another round of model interpretation.</p><h3>Observability for quality and evaluation</h3><p>Operational observability and quality observability are not the same thing in AI systems. A request can complete successfully from an infrastructure point of view — no timeout, no exception, correct tool invocation — and still produce a poor or hallucinated answer.</p><p>Because generative systems can fail semantically rather than operationally, the architecture should retain policy-permitted input/output records, execution traces, and simple user feedback signals (such as thumbs-up or thumbs-down). Aligning with emerging industry practices such as OpenTelemetry for generative AI [5], capturing these privacy-safe pairs and downstream outcomes ensures that real production behaviour can be evaluated asynchronously and turned into new tests, datasets and prompt improvements. The system must observe not only whether it ran, but whether it ran well.</p><h3>Deployment and data protection</h3><p>In alignment with the NIST AI Risk Management Framework (AI RMF) [2], deployment decisions in production AI systems should be driven by data classification, residency requirements and operational risk. Some workloads can safely use managed model endpoints, provided the organisation is satisfied with the provider’s privacy, retention and regional processing controls. More sensitive workloads may require regional isolation, private network paths, customer-managed encryption, hybrid retrieval patterns, or fully self-hosted models where both inference and knowledge sources remain within a controlled environment.</p><p>The architectural question is not simply “cloud or self-hosted”, but which hosting model provides the right balance of privacy, compliance, latency, reliability and operational burden for the use case. At a high level, deployment should follow these principles:</p><ul><li>Keep the harness and runtime in your controlled application environment.</li><li>Keep private data stores and retrieval systems in approved regions and behind private networking where required.</li><li>Treat model hosting as a policy decision: managed, regional, hybrid or self-hosted depending on data sensitivity.</li><li>Use least-privilege identities, encryption and private connectivity between the application, the model endpoint and the data layer.</li></ul><p>In many production designs, the first thing to keep private is not necessarily the model weights, but the path between the application, the retrieval layer and the regulated data, because that is where most business-sensitive context actually resides.</p><h3>What should be reused, and what should remain project-specific</h3><p>One of the most valuable architectural decisions a team can make is to distinguish reusable platform concerns from domain-specific ones. The runtime core, harness structure, lifecycle hooks and tool interface patterns are all strong candidates for reuse. These represent the stable machinery of orchestration and control. They should ideally be built once, hardened over time and configured for different projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6sc3RPzt9z6Qa4eTYEeew.png" /><figcaption>The reusable vs Domain-specific elements, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>By contrast, model providers, retrieval adapters, policy sets and infrastructure connectors are better treated as configurable components. They sit behind interfaces and can be swapped as needs change. This creates flexibility without diluting the architecture.</p><p>Domain tools, domain services and domain data models should remain specific to the project. They express the business itself and should not be overly abstracted for reuse. Attempting to create universally reusable domain logic usually leads to weak abstractions and accidental complexity. The platform should be reusable; the domain should remain honest about its differences.</p><h3>Common architectural mistakes</h3><p>Several patterns appear repeatedly when teams move too quickly from prototype to scale. One is allowing the runtime to own the business logic. This usually happens gradually: a validation rule is added for convenience, then a policy check, then some decision logic that “only applies here”. Before long, the runtime has become a second service layer, but without the clarity or protections of the first.</p><p>Another common mistake is omitting the harness entirely. Systems may appear to function well enough without it, but the absence is quickly felt when audit trails are needed, permissions become more complex, or a regulated action requires accountability. Without a harness, there is rarely a strong answer to who was allowed to do what, under which policy, and with what level of traceability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YE-D0d-wKyh4S7fnvFYjMg.png" /><figcaption>Common architectural mistakes in AI projects, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>A third mistake is over-engineering too early. Teams sometimes rush to introduce sub-agents, complex memory hierarchies, advanced compression strategies and elaborate optimisation layers before the core use case has stabilised. These capabilities can be valuable, but only when there is a real operational reason for them. Complexity should be introduced in response to evidence, not architectural enthusiasm.</p><h3>A sensible starting point</h3><p>For most teams, the right starting architecture is modest but deliberate: an API or application boundary feeding into a harness that handles authentication and logging, then into a runtime that performs orchestration, then into a tooling layer that invokes services that remain the owners of business logic and data integrity. That design is usually enough to move beyond experimentation while avoiding unnecessary early weight.</p><p>Additional concerns, such as memory layers, caching, guardrails, retrieval optimisation, and cost tracking, can then be introduced incrementally as the use case demands. This is a more sustainable path than building an elaborate platform in anticipation of needs that may never materialise.</p><p>The most important principle is that production AI systems should evolve through disciplined layering rather than wholesale reinvention. A team should be able to move from prototype to a structured MVP to a controlled production system by hardening boundaries, clarifying interfaces, and introducing governance in stages. If the architecture forces repeated rewrites at each stage, the original design was too tightly coupled.</p><h3>Conclusion</h3><p>A production AI system is not defined by the model it uses. Models matter, but they do not determine whether a system is safe, maintainable, auditable or fit for sustained operational use. Those qualities emerge from architecture: from how execution is controlled, how responsibility is isolated, how permissions are enforced, and how business truth is protected from probabilistic behaviour.</p><p>For software engineers, this should be reassuring rather than intimidating. The path to production AI is not a rejection of established engineering principles, but an extension of them. Clear boundaries, stable interfaces, separation of concerns, and operational discipline are just as important here as in any other serious system. In many ways, they are more important.</p><p>The teams that succeed will not be those that produce the most elaborate demos. They will be those who understand where intelligence belongs, where control must sit, and how to let systems evolve without surrendering correctness. That is the real work of building AI for production.</p><h3>References</h3><ol><li>OWASP Foundation. (2023). <em>OWASP Top 10 for Large Language Model Applications</em>. [Online]. Available: <a href="https://www.google.com/url?sa=E&amp;q=https%3A%2F%2Fowasp.org%2Fwww-project-top-10-for-large-language-model-applications%2F">https://owasp.org/www-project-top-10-for-large-language-model-applications/</a></li><li>National Institute of Standards and Technology (NIST). (2023). <em>Artificial Intelligence Risk Management Framework (AI RMF 1.0)</em>. U.S. Department of Commerce. NIST AI 100–1.</li><li>Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., &amp; Cao, Y. (2023). <em>ReAct: Synergising Reasoning and Acting in Language Models</em>. International Conference on Learning Representations (ICLR).</li><li>Schick, T., et al. (2023). <em>Toolformer: Language Models Can Teach Themselves to Use Tools</em>. Advances in Neural Information Processing Systems (NeurIPS).</li><li>OpenTelemetry. (2024). <em>Semantic Conventions for Generative AI Systems</em>. Cloud Native Computing Foundation (CNCF).</li><li>Fowler, M., &amp; Lewis, J. (2014). <em>Microservices: a definition of this new architectural term</em>. ThoughtWorks.</li><li>Newman, S. (2021). <em>Building Microservices: Designing Fine-Grained Systems (2nd Ed.)</em>. O’Reilly Media.</li><li>Greshake, K., Abdelnabi, S., Mishra, S., Endres, A., Holz, T., &amp; Fritz, M. (2023). <em>Not what you’ve signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection</em>. ACM Workshop on Artificial Intelligence and Security (AISec).</li><li>Ensign, D., et al. (2024). <em>A Framework for Human-in-the-Loop in Generative AI Systems</em>. IEEE Software.</li><li>Wang, L., Ma, C., Feng, X., Zhang, Z., et al. (2024). <em>A Survey on Large Language Model-based Autonomous Agents</em>. Frontiers of Computer Science.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37300f62a423" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with AI agent orchestration using Paperclip]]></title>
            <link>https://medium.com/@jwill9999/paperclip-a-technical-analysis-of-an-emerging-agent-control-plane-3f77e3877992?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f77e3877992</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 14:35:45 GMT</pubDate>
            <atom:updated>2026-11-01T23:54:32.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*VlkhEq8F0hc2WTNtLp-E1w@2x.jpeg" /><figcaption>Cover image AI-generated with Google Gemini (NotebookLM).</figcaption></figure><h4>How Paperclip coordinates, governs and observes AI agents, and the design patterns worth borrowing</h4><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><h3>Introduction</h3><p>With over 43K stars and nearly 7K forks at the time of writing (April 2026), <strong><em>Paperclip</em></strong> has achieved resounding success in the open-source community for making AI orchestration easy.</p><p>Paperclip represents a shift in how AI-driven systems are structured. Rather than focusing on improving model outputs or prompt strategies, it addresses a different concern: how multiple agents are coordinated, governed, and observed over time.</p><p>The repository positions itself as a control plane. It does not execute models directly, nor does it attempt to abstract them away entirely. Instead, it introduces a layer that manages agents as operational entities. This includes their lifecycle, task allocation, cost constraints, and interaction patterns.</p><p>For engineers familiar with distributed systems, the design will feel recognisable. The distinction is that the “workers” in this system are AI agents rather than traditional microservices.</p><h3>Architectural positioning</h3><p>At a high level, Paperclip separates the system into three concerns: orchestration, execution, and interface.</p><pre>+----------------------+<br>|   Human Operators    |<br>|  (UI / API Clients)  |<br>+----------+-----------+<br>           |<br>           v<br>+----------------------+<br>|      Paperclip       |<br>|   (Control Plane)    |<br>+----------+-----------+<br>           |<br>           v<br>+----------------------+<br>|      Adapters        |<br>| (Execution Bridges)  |<br>+----------+-----------+<br>           |<br>           v<br>+----------------------+<br>|   External Models    |<br>+----------------------+</pre><p>This separation is deliberate. The control plane does not depend on a specific model provider. Instead, execution is delegated to adapters, which act as integration boundaries. This renders the system resilient to upstream changes in model APIs and allows multiple tools to coexist without affecting orchestration logic.</p><p>From an architectural standpoint, this is one of the repository’s strongest decisions. It prevents tight coupling between coordination logic and model behaviour, which is a common source of fragility in early agent implementations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OrK-XUls81KPBnc94VMszQ.png" /><figcaption>Paperclip architecture infographic, AI-generated with Google Gemini (NotebookLM).</figcaption></figure><h3>Operational model</h3><p>The system is built around a small set of primitives. These are not novel individually, but their combination defines how the system behaves.</p><p>An agent represents a worker with a defined role and execution mechanism. An issue represents a unit of work. A heartbeat represents a single execution cycle. Together, these form a state-driven workflow rather than a continuously running process.</p><p>The most important design choice here is that agents are not long-lived processes. They are event-driven. An agent only runs when triggered, executes one cycle, and then returns to an idle state. This avoids the complexity associated with maintaining long-running daemon processes and makes behaviour easier to reason about.</p><p>The execution pipeline reflects this clearly:</p><pre>Wakeup Event<br>     |<br>     v<br>Context Assembly<br>     |<br>     v<br>Session Rehydration<br>     |<br>     v<br>Adapter Execution<br>     |<br>     v<br>Persistence of Results<br>     |<br>     v<br>Idle State</pre><p>This approach aligns closely with job-based or queue-driven systems. It trades immediacy for predictability and traceability, which is a sensible compromise for systems that incur cost on every execution.</p><h3>Agent lifecycle and governance</h3><p>Agent creation follows a controlled path that enforces validation, configuration normalisation, and optional approval. The presence of an approval flow is notable. Many systems defer governance until later stages; Paperclip embeds it at the point of creation.</p><p>An agent may be created in an active state or in a pending state requiring board approval. Importantly, approval does not alter the agent’s configuration or its placement within the organisational hierarchy. It simply changes its eligibility to execute. From a security standpoint, the system ensures that configurations are automatically scrubbed of raw secrets (e.g., API keys are hashed and referenced) via payload redaction before being persisted to approval logs.</p><p>The inclusion of budget policies further reinforces the system’s operational focus. Cost is treated as a first-class constraint. However, the current implementation only governs total spend. It does not control execution frequency (e.g., the maximum number of wakeups per hour), leaving the system vulnerable to rapid looping and unexpected cost spikes before the budget aggregator can intervene.</p><h3>Communication model</h3><p>One of the more opinionated aspects of the system is how agents communicate. There is no direct peer-to-peer messaging between agents. All interaction is mediated through shared state, specifically issues and their associated comment threads.</p><p>Architecturally, this resembles a <strong>Blackboard Pattern</strong>, where agents observe a shared space and react to state changes:</p><pre>Agent A → creates issue → assigns to Agent B<br>Agent B → wakes up, processes → writes result as comment<br>Agent A → resumes when triggered by @mention</pre><p>This hub-and-spoke model avoids the need for complex synchronisation mechanisms. However, because communication relies on free-form text, there are no guarantees regarding schema adherence or completeness. The absence of strict “Structured Outputs” (e.g., enforced JSON schemas for delegated sub-tasks) means that handoffs rely entirely on prompt convention. While this keeps the system flexible, it degrades determinism and reliability in complex workflows.</p><h3>Execution boundary: adapters</h3><p>Adapters are the only place where model execution occurs. They receive a fully prepared context snapshot and return a result along with any updated session state.</p><p>A minimal adapter interface looks as follows:</p><pre>interface ServerAdapterModule {<br>  adapterType: string;<br>  execute(context: AdapterExecutionContext): Promise&lt;AdapterExecutionResult&gt;;<br>}</pre><p>This design keeps the control plane clean; it does not need to understand how a model works, only how to pass context and receive output.</p><p>A notable operational gap, however, is fault tolerance. If an adapter call fails (e.g., a network timeout or upstream API error), the run is marked as failed, and the agent goes back to sleep. There is currently no dead-letter queue (DLQ), automated retry mechanism, or exponential backoff strategy, meaning transient failures require manual intervention or a subsequent natural wakeup.</p><h3>Memory model</h3><p>Paperclip deliberately avoids acting as a full memory system. Instead, it manages operational state and leaves semantic memory for future extension.</p><p>The system distinguishes between three primary layers:</p><ol><li><strong>Per-run context:</strong> Constructed fresh at execution time and discarded afterwards.</li><li><strong>Session memory:</strong> Persisted across runs for a given task, allowing conversational continuity.</li><li><strong>Durable history:</strong> Stored in a PostgreSQL database, including all operational data such as issues, comments, and execution logs.</li></ol><p>Session compaction is handled rigidly through fixed thresholds (e.g., maximums of 200 runs, 2,000,000 tokens, or 72 hours). When limits are reached, the session is reset, and a rule-based plain-text summary is injected into the next run. This prevents unbounded context growth but is blind to semantic importance, meaning critical context can be discarded just as easily as conversational noise.</p><p>The absence of long-term semantic memory (such as a vector database) is a notable limitation. Agents cannot learn from previous tasks beyond what is manually included in context. The repository acknowledges this and outlines a future plugin-based architecture for external memory providers, though it remains unimplemented.</p><h3>Real-time behaviour</h3><p>The system uses WebSockets to propagate state changes to the user interface, prompting the client-side cache (React Query) to invalidate and refresh.</p><pre>Server Event → WebSocket Broadcast → Client Cache Invalidation → UI Re-render</pre><p>This approach is effective in simple scenarios but lacks resilience against partition tolerances. Events are simply broadcast and dropped if the socket is not open. There is no event buffer, Write-Ahead Log (WAL), or replay capability. If a connection drops, updates may be missed entirely, forcing the client to do a full state refresh upon reconnection.</p><h3>Installation and local setup</h3><p>Paperclip needs Node.js 24.11 or newer and pnpm 9.15 or newer. The quickest route is the official one-line install:</p><pre>npx paperclipai@latest onboard --yes</pre><p>To run it from source instead, clone the repository, install dependencies and start the development server:</p><pre>git clone https://github.com/paperclipai/paperclip.git<br>cd paperclip<br>pnpm install<br>pnpm dev</pre><p>This starts the UI and API at http://localhost:3100. An embedded PostgreSQL database is created automatically, so no database set-up is needed. For other options, see the installation guide: <a href="https://docs.paperclip.ing/reference/cli/installation/">https://docs.paperclip.ing/reference/cli/installation/</a></p><h3>Areas for improvement</h3><p>The repository exposes several areas where further engineering work would have a meaningful impact on enterprise readiness:</p><ul><li><strong>Deterministic communication:</strong> Transitioning from free-text handoffs to enforced JSON schemas (structured delegation results) between agents to improve the reliability of multi-agent workflows.</li><li><strong>Execution throttling:</strong> Implementing rate limiting (e.g., a maximum number of wakeups per hour) to complement the existing budget constraints and prevent runaway loops.</li><li><strong>Fault tolerance:</strong> Introducing an automated retry mechanism with exponential backoff and a Dead Letter Queue (DLQ) for failed heartbeat runs.</li><li><strong>Semantic memory:</strong> Transitioning from rigid, threshold-based session summaries to a pluggable vector memory layer, allowing agents to retain context across independent tasks.</li><li><strong>Event sourcing resilience:</strong> Adding sequence tracking and an in-memory replay buffer to the WebSocket pipeline to ensure clients remain consistent during network interruptions.</li></ul><h3>Conclusion</h3><p>Paperclip is not a complete, out-of-the-box solution, but it is a highly useful exploration of an increasingly relevant problem. As architectures move from single-agent LLM wrappers to coordinated, asynchronous workflows, the need for a control layer becomes acute.</p><p>The repository demonstrates that the complexity of AI engineering no longer lies solely in calling a model. It lies in managing the lifecycle, coordination, security, and constraints of multiple agents operating over time.</p><p>For software engineers, the value of Paperclip lies less in adopting it directly and more in understanding the patterns it introduces. These patterns are likely to influence how agent-based distributed systems are designed in the near future, particularly in environments where governance and reliability matter just as much as AI capability.</p><h3>Resources</h3><ul><li>Paperclip on GitHub: <a href="https://github.com/paperclipai/paperclip">https://github.com/paperclipai/paperclip</a></li><li>Paperclip architecture overview: <a href="https://github.com/paperclipai/paperclip/blob/master/docs/start/architecture.md">https://github.com/paperclipai/paperclip/blob/master/docs/start/architecture.md</a></li><li>Paperclip product document: <a href="https://github.com/paperclipai/paperclip/blob/master/doc/PRODUCT.md">https://github.com/paperclipai/paperclip/blob/master/doc/PRODUCT.md</a></li><li>Paperclip installation guide: <a href="https://docs.paperclip.ing/reference/cli/installation/">https://docs.paperclip.ing/reference/cli/installation/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f77e3877992" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do You Need a Custom Agent Runtime and Harness? How to Tell When]]></title>
            <link>https://medium.com/@jwill9999/do-engineers-need-to-build-an-agent-runtime-and-harness-if-so-when-2065bbdb035b?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/2065bbdb035b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 00:26:05 GMT</pubDate>
            <atom:updated>2026-11-01T23:56:53.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IqXZHSiqPxgpyTrYN4iqQ.png" /><figcaption>Cover image AI-generated with Google Gemini (NotebookLM).</figcaption></figure><p>Add structure too early and you kill momentum; leave it too late and the system turns fragile.</p><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2294115011%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fjason-williams-145%2Fthe-agent-runtime-and-harness&amp;image=https%3A%2F%2Fi1.sndcdn.com%2Fartworks-TfB5KaBsHdESRggu-vdJMxA-t500x500.jpg&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c43e7a915aec52f4cdf96ef58b96a4e/href">https://medium.com/media/8c43e7a915aec52f4cdf96ef58b96a4e/href</a></iframe><p>As software systems take on more decision-making responsibilities, an architectural question inevitably comes up: should engineers build a custom execution environment and control layer for these systems, or is that just over-engineering?</p><p>The answer comes down to context. Introduce heavy structure too early, and you kill momentum. Ignore it for too long, and you end up with an unpredictable, fragile system. Figuring out exactly when to make that transition is a practical skill engineers now need to develop.</p><h3>What Are We Actually Talking About?</h3><p>The terms “harness” and “runtime” are thrown around a lot, often interchangeably. To avoid getting bogged down in terminology, it helps to break the architecture down into three distinct pieces:</p><p>1. The Application Layer (Shaping Behaviour)</p><p>This is the logic of your system. Libraries like LangChain or LlamaIndex live here. They dictate how a system generates its outputs, offering patterns for structuring prompts, connecting basic steps, and formatting requests to external APIs. This layer decides what needs to be done.</p><p>2. The Harness (Governing Behaviour)</p><p>If the application layer is the logic, the harness is the sandbox and safety equipment. This is your control layer. It does not generate answers; instead, it decides what the system is actually allowed to do. A harness manages context limits, intercepts and validates inputs and outputs, and logs every step for observability. Most importantly, it enforces hard rules on external actions to ensure the system cannot cause damage.</p><p>3. The Runtime (Keeping It Running)</p><p>This is the engine that actually powers the workload. While the harness sets the rules, the runtime handles the mechanics of execution. This is where tools like LangGraph or traditional workflow engines sit. A runtime focuses purely on reliability. It manages state, pauses and resumes long-running tasks, handles network retries, and ensures the system recovers gracefully when a step inevitably fails.</p><p>Put simply: the application logic determines the steps, the harness keeps those steps safe, and the runtime ensures they actually finish.</p><figure><img alt="AI runtime and harness" src="https://cdn-images-1.medium.com/max/849/1*sSXIrWJ-gwTiaHzmYkqRIQ.png" /><figcaption>Image AI-generated with Google Gemini (NotebookLM).</figcaption></figure><h3>Why This Is Becoming Relevant</h3><p>Many developers get their first taste of agentic systems through tools like GitHub Copilot or Claude Code. Because these tools feel so complete and tightly integrated into daily workflows, they set a deceptively high expectation.</p><p>But they operate under strict conditions: they run locally, have well-defined boundaries, and rely entirely on a human sitting at the keyboard. If the agent makes a strange decision, the developer immediately intervenes.</p><p>The providers of these tools are doing the heavy lifting by hiding a massive control-and-execution setup behind the scenes. This creates a false sense of security. It is easy to assume that building your own production systems will be just as straightforward. Usually, it isn’t.</p><h3>The Reality of Production</h3><p>Ask any team that has tried to push an LLM-based system to production, and you will hear a similar story: generating a clever output is easy; keeping the system reliable is the hard part.</p><p>Research from groups like the RAND Corporation backs this up, showing a high failure rate for projects trying to move past the prototype phase. The roadblocks usually are not about AI capabilities. They are about integration, reliability, and basic operational hygiene. It is simple to make a demo work on a laptop, but much harder to guarantee it behaves consistently in the wild.</p><p>Traditional backend services are built for short, predictable request-response cycles. Agentic workflows are the exact opposite. They run for extended periods, rely on intermediate steps, and yield non-deterministic results. Forcing these workloads into infrastructure designed for quick, stateless web requests is a recipe for brittle architecture.</p><h3>When This Is Not a Concern</h3><p>To be clear, plenty of projects do not need a custom runtime or harness.</p><p>If you are prototyping, running short-lived tasks, or building “human-in-the-loop” tools where a user constantly reviews outputs, adding complex layers is just a distraction. Standard libraries are more than enough. They give you speed, flexibility, and let you ship fast. In early-stage work, keeping things simple always wins.</p><h3>When It Starts to Matter</h3><p>You generally realise you need more structure when you hit a few specific friction points:</p><p>Long-running processes: When tasks take minutes instead of milliseconds, the chance of a network hiccup or API timeout skyrockets. If you cannot save progress and resume from the point of failure, you will waste computing time and annoy your users.</p><p>Removing the human: Once a system is expected to operate without someone watching it, it has to regulate itself. It needs to sanitise its inputs, verify its outputs, and restrict its actions.</p><p>Security and blast radius: Running a script locally with your own API keys is one thing; putting it in a shared or public environment is another. You need hard boundaries to stop an agent from dropping a database table or spamming a third-party API.</p><p>Observability: When standard software breaks, you get a stack trace. When an agentic system breaks, it is rarely obvious why. Without a harness that logs every intermediate thought and action, debugging is a nightmare.</p><p>Vendor lock-in: Relying entirely on a single framework is convenient on day one, but painful later. Separating the application logic from the execution runtime gives you the freedom to swap out underlying tools as the technology changes.</p><h3>How Teams Typically Approach This: The Build vs. Adopt Dilemma</h3><p>Nobody sits down and designs a flawless agent runtime from scratch on day one.</p><p>Most teams start by writing quick scripts to see what the models can do. As the codebase grows, they adopt basic design patterns to keep things organised. Next, they add a few guardrails for safety. It is only when the system handles actual production traffic that they finally invest in a dedicated execution setup.</p><p>But how exactly do they do that? When it comes time to formalise the system, teams face a distinct choice: adopt an open-source framework, or build a custom setup. The right path depends almost entirely on whether you are building for speed or for strict compliance.</p><h3>The Open-Source Framework Route</h3><p>(Best for Commercial Products, Startups, and Fast Iteration)</p><p>Today, there are off-the-shelf open-source tools (such as LangGraph and similar frameworks) designed specifically to serve as an agent runtime.</p><p>How it works in practice: You hand over the heavy lifting to the framework. You adopt their specific patterns for managing state, routing tasks, and executing tools.</p><p>The advantage: Speed. If you are building a commercial SaaS product, time to market is everything. These tools give you an out-of-the-box architecture, meaning your team does not have to spend weeks writing boilerplate code just to get an agent to retry a failed step.</p><p>The catch: The open-source AI ecosystem moves incredibly fast. If you rely heavily on these frameworks, you are tying your infrastructure to dependencies that frequently push breaking changes. You also have to build the system their way, which can box you in when your use case inevitably becomes more complex.</p><h3>The “From Scratch” Route</h3><p>(Best for Enterprise, Regulated Industries, and Legacy Integration)</p><p>It is important to clarify that building “from scratch” rarely means writing a custom Task Scheduler task in Python from the ground up. In practice, it means taking proven, traditional distributed systems tools — like Temporal, AWS Step Functions, or custom message queues — and treating the LLM as just another step in a standard workflow.</p><p>How it works in practice: Your engineers write a custom harness to wrap the LLM calls (handling the prompts, context, and input validation), but you let established, enterprise-grade workflow engines act as the runtime to handle state, timeouts, and retries.</p><p>The advantage: Absolute control and security. You are not relying on a shiny new AI framework to handle critical infrastructure. You own the data pipeline, you can enforce strict network boundaries, and you get deep, granular logging for every single action.</p><p>The catch: It is expensive. It requires a team that understands distributed systems, not just prompt engineering. It takes much longer to build and requires a higher level of engineering maturity to maintain.</p><h3>The Enterprise vs. Commercial Divide</h3><p>Ultimately, this decision comes down to your risk profile.</p><p>If you are building a commercial product aimed at consumers or small businesses, speed and flexibility win. Adopting an open-source runtime allows you to ship fast, iterate based on user feedback, and worry about scaling infrastructure later.</p><p>However, if you are an enterprise dealing with healthcare records, financial data, or strict compliance requirements (such as SOC 2 or GDPR), the “black-box” nature of some open-source AI frameworks is a liability. In these environments, teams almost always lean towards custom-built harnesses sitting on top of hardened, non-AI-specific runtimes. They happily trade development speed for auditability, security, and trust.</p><p>Not every project survives long enough to reach this crossroad, but the ones that do all face the exact same growing pains.</p><h3>Is This Overcomplicating Things?</h3><p>You might be thinking: Isn’t this just over-engineering? Won’t cloud platforms eventually abstract all of this away?</p><p>They probably will.</p><p>But until managed solutions fully mature, the core problems of reliability, control, and visibility are not going away. Someone still has to solve them — whether you build the tooling yourself or carefully configure a third-party service.</p><h3>The Takeaway</h3><p>You do not need to overbuild your infrastructure just to get a basic agent off the ground. Doing so too early will just slow you down.</p><p>The trick is recognising the tipping point. Once your system shifts toward longer execution times, autonomous actions, and strict reliability requirements, your priorities have to change. At that stage, you are not just trying to generate a good text response anymore. You are trying to deliver a stable, safe, and repeatable software product.</p><p>Knowing when to make that jump is rapidly becoming a core part of modern engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2065bbdb035b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving AI agents from local development to production: a security guide for solo developers]]></title>
            <link>https://medium.com/@jwill9999/moving-ai-agents-from-local-development-to-production-a-security-guide-for-solo-developers-4b1dc9d7220e?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b1dc9d7220e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 23:54:26 GMT</pubDate>
            <atom:updated>2026-11-01T23:45:46.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGSBJuU4eZ0pETwACX0GzQ.png" /><figcaption>Building the open agent stack</figcaption></figure><p>Multi-tenancy, strict server-side rules and open-source tooling to lock an agent down before real users touch it.</p><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><p><em>Updated October 2026 for OpenShell 0.1.x.</em></p><p>Building an AI agent on your laptop is exciting, and getting it to work locally is a great milestone. But when you are a solo developer ready to launch your application to the public, putting that agent on a live server is a completely different challenge.</p><p>Right now, most tutorials for autonomous agents assume a single-developer setup running on a local machine. While this is great for building prototypes, it breaks down when you launch a startup and need to safely manage multiple users at once (multi-tenancy) while keeping their data secure.</p><p>When you release a live application, you cannot rely on telling the AI to “be nice” in the system prompt. Instead, you need to rely on strict server rules. Here is a practical guide to using open-source tools to secure your AI agents for a production release, including setup and configuration.</p><p><strong>1. Why you need strict server rules</strong></p><p>When you build an AI application, you are combining three main parts:</p><ul><li>The model: The intelligence, like the LLM.</li><li>The runtime: The environment where the agent actually runs and executes code.</li><li>The harness: The application code that gives the agent memory and tools.</li></ul><p>As a startup planning to scale, you have to assume that if an agent has access to a tool or a file, it will eventually try to use it. Even if a large client uses your app later, they will not care about the agent’s intended behaviour; they will only care about what your server physically allows the agent to do. You must control what the agent can access by locking down the infrastructure around it.</p><p><strong>2. The four-layer defence model</strong></p><p>If your agent can write and run its own code, your server needs a safe, isolated environment called a sandbox. NVIDIA OpenShell is an open-source tool that puts each agent into its own isolated sandbox. It enforces four layers of defence: the first three are set in a YAML policy file, and the fourth comes from OpenShell’s credential providers:</p><ul><li>Filesystem layer: This prevents the agent from reading or writing files outside a specific folder (such as /sandbox). It is locked when the sandbox is created, which stops the agent from accidentally modifying your main server files.</li><li>Network layer: This blocks the agent from making unauthorised outbound requests to random websites.</li><li>Process layer: This stops the agent from gaining admin rights or running dangerous system commands on the host server.</li><li>Credentials layer: Keys you register as OpenShell providers are held by OpenShell, and the agent only sees placeholders; the real key is used only at approved endpoints. In this guide’s setup, the harness (ChatNVIDIA and create_deep_agent) runs on your server, so your model key stays in your application’s environment, outside the sandbox.</li></ul><p>A practical tip: You can use the openshell policy set command to update network rules while the agent is running. This means you do not have to restart your whole application if you need to give an agent access to a new website.</p><p><strong>3. Managing multiple users</strong></p><p>When your startup launches, you will need a way to securely run separate agents for different users. OpenShell gives each agent its own isolated sandbox and runs those sandboxes through a compute driver: Docker, Podman or MicroVM on a single server, or Kubernetes when you need shared clusters or remote compute. This means you can start on one server and manage multiple isolated user environments without needing a complex Kubernetes set-up from day one.</p><p>To manage the agent’s tasks and memory, you can use LangChain Deep Agents. It separates where the agent thinks from where it stores data. It allows you to save the agent’s memory and learned skills locally on your server. If you start out using cloud APIs but later decide to move everything to your own private servers to save money or protect user data, you can swap the backend without rewriting your application code.</p><p><strong>4. Speeding things up with GPUs</strong></p><p>As your application grows, your agents might need to handle heavier tasks, such as processing large files or running local code. Relying entirely on cloud APIs can get expensive and risks leaking sensitive startup data.</p><p>By passing the --gpu flag when you create an OpenShell sandbox, you give that sandbox access to a GPU on the host, so heavy code or data processing inside it can use the graphics card. That is separate from where the model runs. In this guide’s code, ChatNVIDIA uses its default setting, which sends prompts to NVIDIA’s hosted API (https://integrate.api.nvidia.com/v1). To keep user data on infrastructure you control, run an open model such as NVIDIA Nemotron 3 Nano on your own NIM server and point ChatNVIDIA at it with base_url. Only then do prompts and user data stay private.</p><p><strong>5. Keeping API keys safe</strong></p><p>Your agents need API keys to use external tools. However, you should never save these keys in the same folder as the agent. If you do, a malicious user could trick the agent into reading the file and exposing your startup’s private keys.</p><p>OpenShell handles this problem using providers. You store a key once with the openshell provider create command, and OpenShell keeps it with the provider rather than in the agent’s folder. The agent inside the sandbox never sees the real value: OpenShell gives it an opaque placeholder, and the proxy swaps in the real key only when a request goes to an approved endpoint. To make things easier, the CLI can also read an existing key from your shell environment. The documentation shows this for Claude Code: openshell provider create --name my-claude --type claude-code --from-existing reads ANTHROPIC_API_KEY or CLAUDE_API_KEY.</p><p><strong>6. Setting up your harness and runtime</strong></p><p>To put this into practice, you need to connect your application code (the harness) to your secure server environment (the runtime). Here is how a solo developer can set this up on a fresh server.</p><p>First, you need to install the runtime. Assuming you have Docker installed on your server, you can install the OpenShell command-line tool with NVIDIA’s install script, which also starts a local gateway, and then check that it is running:</p><pre>curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh<br>openshell status</pre><p>Then install the Python packages for your application: the OpenShell SDK, LangChain Deep Agents, the OpenShell backend for Deep Agents and the NVIDIA chat model integration.</p><pre>pip install openshell deepagents langchain-nvidia-openshell langchain-nvidia-ai-endpoints</pre><p>Next, you create a secure sandbox for a new user session. If you have a GPU and installed the correct drivers, you can add the --gpu flag here. OpenShell’s docs pair it with a GPU-capable image passed via --from.</p><pre>openshell sandbox create --name user-session-1</pre><p>Now, you switch to your Python application code. You will use LangChain Deep Agents to act as the harness. This code connects your LLM to the secure OpenShell sandbox you just created.</p><pre>import openshell<br>from deepagents import create_deep_agent<br>from langchain_nvidia_ai_endpoints import ChatNVIDIA<br>from langchain_nvidia_openshell import OpenShellSandbox<br><br># Connect to the secure runtime you created in the terminal<br>client = openshell.SandboxClient.from_active_cluster()<br>try:<br>    secure_runtime = OpenShellSandbox(<br>        sandbox=client.get_session(&quot;user-session-1&quot;, workspace=&quot;default&quot;)<br>    )<br>    # Set up the harness (the agent&#39;s brain and tools)<br>    # By default, ChatNVIDIA calls NVIDIA&#39;s hosted API<br>    # (https://integrate.api.nvidia.com/v1). To keep data on your own<br>    # servers, add base_url=&quot;http://localhost:8000/v1&quot; for a self-hosted NIM<br>    agent = create_deep_agent(<br>        model=ChatNVIDIA(model=&quot;nvidia/nemotron-3-nano-30b-a3b&quot;),<br>        system_prompt=&quot;You are a careful coding agent.&quot;,<br>        backend=secure_runtime,<br>    )<br>    # Give the agent a task<br>    result = agent.invoke({&quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;,<br>        &quot;content&quot;: &quot;Download the user dataset and write a script to format it.&quot;}]})<br>    print(result[&quot;messages&quot;][-1].content)<br>finally:<br>    client.close()</pre><p><em>Code checked against the documentation for OpenShell 0.1.x; not run end to end</em></p><p>In this setup, create_deep_agent builds the harness that handles the logic, memory and model calls. Meanwhile, OpenShellSandbox sends every shell command and file operation the agent makes into the user-session-1 sandbox, so the code it writes runs there rather than on your server. If the agent makes a mistake and tries to touch files outside what the sandbox policy allows, OpenShell blocks the operation.</p><p><strong>7. Getting memory right: configuring the harness</strong></p><p>Setting up memory correctly is fundamental. Without it, your agent starts from scratch every time a user sends a message, making your application useless for continuous tasks. In Deep Agents, two settings work together: the backend= parameter decides where the agent’s files are stored, and the memory= parameter lists AGENTS.md files that the agent loads at start-up. The LangChain documentation describes several backends, so you can choose the right option for your startup stage:</p><ul><li>State backend (the default): Files live in the agent’s state for a single conversation thread. They persist across turns through your checkpointer but are not shared between threads. Good for initial testing.</li><li>Filesystem backend: Gives the agent access to a folder on your machine (an absolute root_dir). Useful for local development.</li><li>Store backend: Keeps files in a LangGraph store, so memories persist across threads. As your startup scales, that store can sit on a database such as Postgres or Redis.</li><li>Composite backend: Routes different paths to different backends, for example keeping most files per thread while persisting /memories/ across threads.</li><li>Local shell backend: Runs file and shell operations directly on the host with no isolation, so use it only in controlled development environments. In this guide, the OpenShell sandbox does that job safely instead.</li><li>Model choice: You are not locked into using the NVIDIA Nemotron model. The model parameter is entirely flexible. If you want to use OpenAI, Anthropic, or an open-source model like Meta Llama, you simply change that one line of code. This is perfect for a solo developer because you can build your initial prototype with a cheap cloud API and then easily switch to a secure, locally hosted model when your startup requires stronger data privacy.</li></ul><p><strong>8. Top fine-grained security configurations</strong></p><p>When your application goes live, you need strict boundaries. If an agent gets stuck in a loop or a user tries to hijack it, it could crash your server or cause a massive API bill. You prevent this by using fine-grained configurations in the runtime (OpenShell). Junior engineers should be aware of these top controls, which build on the four layers from section 2:</p><ul><li>Granular egress filtering (network layer): Instead of just allowing access to a broad website, you can write a YAML rule that only allows ‘GET’ requests to specific API paths (like downloading a file). This strictly blocks ‘POST’ requests, stopping an agent from uploading your private startup data to an external server.</li><li>System call restrictions (process layer): You can block the agent from running specific low-level system commands. By applying strict ‘seccomp’ profiles in your configuration, you prevent the agent from opening new network ports or spawning hidden background tasks.</li><li>Short-lived sandboxes: Create a sandbox with --no-keep and OpenShell deletes it as soon as the agent’s command exits, so nothing lingers between runs.</li><li>Credential expiry (credentials layer): You can record an expiry time on a provider credential with openshell provider update --credential-expires-at. This is expiry metadata on the credential, not a timer on the sandbox: once the time has passed, OpenShell stops supplying that credential to sandboxes, and running sandboxes reject it.</li><li>Resource caps: You can set hard limits on CPU and RAM. For example, limiting a sandbox to 1 CPU core and 2GB of memory ensures a single runaway agent cannot hoard your entire server, keeping your app online for other users.</li></ul><p><strong>Summary</strong></p><p>Taking your AI agent from a local test script to a live product requires a change in how you think about security. Instead of trusting the AI model to follow instructions, you must enforce security rules outside the agent’s own code.</p><p>By combining LangChain Deep Agents to manage application logic and memory with NVIDIA OpenShell to secure the server environment, solo developers can build a safe, production-ready application. This approach ensures your agents run in a secure, multi-tenant system that can grow from a startup release to an enterprise-grade product.</p><p><strong>Resources</strong></p><p><a href="https://docs.nvidia.com/openshell/latest/">[1] NVIDIA OpenShell Runtime</a>: An open-source tool for running AI agents in secure sandboxes, with policies that enforce security rules outside the agent’s control.</p><p><a href="https://docs.langchain.com/oss/python/deepagents/overview">[2] LangChain Deep Agents</a>: An open-source agent harness, built on LangGraph, for long-running tasks, planning, sub-agents and persistent memory.</p><p><a href="https://github.com/NVIDIA/NemoClaw">[3] NVIDIA NemoClaw</a>: NVIDIA’s open-source reference stack for running AI agents inside OpenShell sandboxes.</p><p><a href="https://github.com/langchain-ai/langchain-nvidia/tree/main/libs/openshell">[4] OpenShell backend for Deep Agents (langchain-nvidia-openshell)</a></p><p><a href="https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh">[5] OpenShell install script</a></p><p><a href="https://docs.langchain.com/oss/python/integrations/chat/nvidia_ai_endpoints">[6] ChatNVIDIA integration (langchain-nvidia-ai-endpoints)</a></p><p><a href="https://build.nvidia.com/nvidia/nemotron-3-nano-30b-a3b">[7] NVIDIA Nemotron 3 Nano</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b1dc9d7220e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI Is Reshaping Software Development]]></title>
            <link>https://medium.com/@jwill9999/ais-role-in-reshaping-software-development-c4f55e9cee2d?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4f55e9cee2d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 06:53:03 GMT</pubDate>
            <atom:updated>2026-11-02T00:04:33.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiZtcTifuQSmmEmNDCGKmQ.png" /><figcaption><strong>Engineering outcomes through active collaboration, AI-generated.</strong></figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2136791484%26show_artwork%3Dtrue&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsoundcloud.com%2Fjason-williams-145%2Fais-role-in-reshaping-software-development%3Futm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fi1.sndcdn.com%2Fartworks-CcSiyEtEUqRsXLl9-MQqgPQ-t500x500.jpg&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccfe17acdd5bfea7db8705bdc22a1a58/href">https://medium.com/media/ccfe17acdd5bfea7db8705bdc22a1a58/href</a></iframe><p><em>This piece was written by Jason Williams with AI assistance for research and editing. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><h3>The shift toward AI-augmented engineering</h3><p>Software engineering is no longer defined solely by the code we write. It’s increasingly shaped by the systems we orchestrate, the intelligence we guide, and the workflows we refine. The modern engineer is stepping into a transformative era where artificial intelligence acts as a powerful collaborator. This marks a pivotal moment in technological history comparable to the advent of high-level programming languages or the Internet. AI’s integration into the engineering life cycle is fundamentally altering how software is conceived, developed, tested, and deployed. This podcast kicks off a series exploring the rapid evolution of software engineering in the age of GenAI.</p><h3>So, how is GenAI transforming engineering today?</h3><p>Agentic collaboration is already delivering substantial advancements in productivity and software quality, but leveraging AI effectively demands a shift in mindset. Developers must engage these tools as extensions of their own capabilities. That means learning to interact with AI systems, understanding their strengths and limitations, and embedding them seamlessly into real-world workflows.</p><p>The future of engineering lies in this guided partnership between human ingenuity and intelligent automation.</p><h3>Engineer as Conductor, Not Spectator</h3><p>A common misconception suggests that AI will make engineers obsolete. In practice, unsupervised AI often produces brittle systems riddled with subtle errors, hallucinated logic, or flawed scaffolding. Like any sophisticated instrument, AI requires skilled hands to direct its output.</p><p>Evidence supports this.</p><ul><li>CSET found that over 50% of AI-generated code includes bugs or vulnerabilities.</li><li>MIT research shows that AI often passes initial tests but fails in real-world deployments.</li><li>Secure Flag highlights risks such as outdated libraries and fabricated APIs.</li></ul><p>Given these limitations, engineering leadership is essential. Robust AI workflows must follow these key principles.</p><ol><li>Prompt clarity. We must provide specific input with architectural context and design constraints.</li><li>Review and validation. We apply human-led inspections, tests, and audits to ensure quality.</li><li>Iteration. We use agile, feedback-driven cycles to refine AI outputs and improve code logic.</li><li>Domain alignment. The engineer will bring contextual knowledge AI lacks, ensuring functional relevance.</li></ol><blockquote>In this type of approach, we direct, not delegate.</blockquote><p>The prompt is the new unit of software craftsmanship.</p><h3>So, how do we do this in practice?</h3><h4>Introducing prompt-driven development, PDD.</h4><p>PDD is a modern engineering methodology designed for AI-assisted environments. In prompt-driven development, engineers act as orchestrators, crafting effective prompts, refining outputs, and maintaining oversight.</p><p>Prompt-driven development moves beyond early, unstructured vibe coding, which often led to bloated or unmaintainable solutions. Instead, it aligns with principles of maintainability, testability, and scalability.</p><p>Prompts are treated as first-class artefacts, versioned, reusable, and iteratively improved. Engineers learn from each interaction, building libraries of effective AI directives; AI provides automation muscle. Engineers provide strategic direction and domain understanding.</p><p>Just as test-driven development uses tests to shape code, prompt-driven development uses structured prompting and validation to shape AI contributions.</p><figure><img alt="Flow diagram illnustrating Prompt Driven Development workflow" src="https://cdn-images-1.medium.com/max/1024/1*DbfFz8Ilg08hhd4kbt0LjA.png" /><figcaption>Image AI-generated with OpenAI Codex.</figcaption></figure><h3>Enhancing Prompt-Driven Development</h3><blockquote><strong>PDD vs. Vibe Coding</strong><br><em>Vibe coding</em>: Fast, informal, unstructured prompting often results in low-quality or hallucinated outputs.<br><em>PDD</em>: Disciplined, version-controlled, and validated AI collaboration using engineered prompts, feedback loops, and reviewable artefacts.</blockquote><p>Effective PDD relies on the right tools and process maturity. These tools form the foundation of a broader engineering platform for orchestrating AI. For us to get this right means we have to give the GenAI some workspace awareness.</p><p>Coding environments like VSCode, Gemini, and Claude CLI tooling can offer a way for the Software Engineer to provide the AI with greater context awareness of the workspace. These Markdown files can give the AI an understanding of the project’s structure, its dependencies, and coding patterns, leading to more intelligent, context-aware suggestions.</p><p>We also need our teams to maintain shared Markdown files and prompt libraries that evolve alongside the code base. These artefacts standardise how AI behaves across features, ensuring predictable and auditable outcomes. Providing tooling such as a model context protocol, an MCP server, will enable some external orchestration, which will enable a more sophisticated agentic behaviour by injecting JSON-formatted task specifications and environmental context.</p><p>Together, these building blocks allow engineering teams to implement continuous, feedback-driven AI workflows. Iteration is essential, not just of code, but of prompts, workflows, and validation standards. Over time, organisations must build internal ecosystems where prompt logic is versioned, peer-reviewed, and improved like any other high-quality code artefact.</p><h3>So, why does this all matter?</h3><p>It matters because AI is already transforming our engineering landscape. This isn’t something that will happen in the future. It’s happening now, right now!</p><p>Current statistics show GitHub Copilot contributes nearly 50% of developer code, and over 90% of Fortune 500 companies are deploying AI already. This year, 2025, Big Tech is projected to invest over $300 billion in AI infrastructure.</p><p>The shift towards AI orchestration is seeing new engineering skills and experience being sought, not just within tech giants, but across all parts of the industry, even startups. Engineers need to adapt from being solely syntax-focused developers to becoming system designers and prompt engineers. Those who embrace this transformation will succeed, while those who resist it risk becoming obsolete.</p><p>This isn’t about outsourcing thought to AI. It’s about active, intelligent collaboration, engineering outcomes, not just code. So you may be wondering, this is all good and well, but what about security and data protection?</p><h3>And what ethical and compliance considerations should organisations take?</h3><p>As AI becomes integral to software development, it brings significant ethical and compliance concerns. Organisations must address these risks to deploy AI responsibly to maintain customer trust and regulatory alignment. So let’s take a look at some of these in turn.</p><p>Firstly, data privacy. AI tooling must be governed to avoid accidental ingestion of personal or proprietary data. Engineering workflows should integrate guardrails for input-output inspection and redaction.</p><p>Secondly, model accountability. Prompt artefacts and output reviews should be versioned and traceable to support auditability and forensic analysis.</p><p>Thirdly, bias and fairness. AI models trained on biased data may produce discriminatory or inappropriate outputs. Diverse prompt engineering and output validation help mitigate systemic biases.</p><p>Next, licensing and IP risk. Generated code can inadvertently replicate licensed or copyrighted material. Engineers should use filtering tools and license-aware prompts to reduce exposure.</p><p>And last but not least, hallucination control. Processes must be in place to detect and suppress AI-generated inaccuracies or hallucinated logic, especially in high-risk domains.</p><h3>So, what are some of the best practices we should be adopting?</h3><ol><li>Establish organisational prompting guidelines and review protocols.</li><li>Integrate AI outputs into CI/CD validation gates.</li><li>Leverage third-party tools for privacy scanning and IP compliance.</li><li>Maintain access logs and model interaction histories.</li></ol><p>Addressing these factors is not just good practice; it will soon be essential for regulatory alignment and customer trust.</p><p>So that’s a lot of information to digest, so let’s recap some of the key points we can take away today.</p><h4>TL;DR</h4><blockquote>AI is reshaping software development not by replacing engineers, but by requiring them to evolve into strategic orchestrators.</blockquote><blockquote>Prompt-driven development is the framework that empowers teams to direct AI effectively, ensuring quality, control, and collaboration.</blockquote><h3>So, what comes next?</h3><h4>And how can we start putting this into practice if we are not to be left behind?</h4><p>In part two, we shift from theory to practice. We’ll explore how engineers can apply the PDD approach in real-world workflows and take tangible steps to integrate GenAI tools into their workflows.</p><ul><li>You’ll also learn how to start crafting and refining prompts that align with your architecture and goals, and practical ways to use Markdown files and prompt libraries across teams.</li><li>We will also learn how embedding context can improve AI reliability and reduce hallucinations.</li><li>The integration of the Model Context Protocol, MCP, to orchestrate sophisticated agent workflows.</li><li>A practical walkthrough of the full PDD life cycle from ideation to deployment.</li><li>And finally, we will look at methods to validate AI outputs using checklists, peer reviews, and automated tests.</li></ul><h3>✍️ About the Author</h3><p><strong>Jason Williams</strong><br>Software Engineer | FinTech | GenAI Development Advocate <br>Passionate about shaping the future of software engineering through Prompt-Driven Development (PDD) and intelligent automation.<br>📍 Sharing insights at the intersection of human ingenuity and generative AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4f55e9cee2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Execution Context the forgotten parts.]]></title>
            <link>https://medium.com/@jwill9999/the-execution-context-the-forgotten-parts-9e59e011873a?source=rss-4a7d8d02ec85------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e59e011873a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[interview-tips]]></category>
            <dc:creator><![CDATA[Jason Williams]]></dc:creator>
            <pubDate>Mon, 11 Feb 2019 01:57:13 GMT</pubDate>
            <atom:updated>2026-11-02T00:09:08.089Z</atom:updated>
            <content:encoded><![CDATA[<h3>The execution Context the forgotten parts.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXTs0yMmiOK9yuFKLqXTMA.png" /><figcaption>Cover image AI-generated with an AI image tool.</figcaption></figure><p><em>This piece was written by Jason Williams. Views are purely my own, and I don’t speak on behalf of Experian or ECS UK&amp;I.</em></p><p>The JavaScript engine is an engine like no other. It’s functions and capabilities reach far beyond what we are going to cover here today, however we will aim to highlight and discuss some of the inner workings of the execution context and the key processes that take place.</p><p>This is an overview so references and further reading is available after the articles main body, so you can obtain further context about the issues we discuss.</p><h4>So what is the execution context?</h4><p>The execution context is like a wrapper around the code <strong><em>that is currently running on the execution stack</em></strong>.</p><p>There are two types of execution context that we will discuss here.</p><ol><li>The Global Execution context.</li><li>The function execution context.</li></ol><p>The first process that occurs is the creation of the Global Execution Context.</p><p>There are <em>two main phases</em> to the Global execution context.</p><ol><li>The Creation Phase</li><li>The Execution Phase</li></ol><h3>The Creation Phase</h3><p>In the creation phase , the JavaScript engine will parse our code from top to bottom. It is during this first pass that the JavaScript engine will perform the following key steps.</p><ol><li>It will create a Global object.</li><li>The “this” keyword is defined.</li><li>A link to the Outer Environment is created.</li><li>Creates a variable object.</li><li>Hoisting.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kzr6_jOGxgIsjwhGa9SaQ.png" /><figcaption>Image by the author.</figcaption></figure><p>We can see this in the follow code snippet. We have an editor which contains no code, however if we run it we can see that we create a Global object ( window ), and a reference to the “this” keyword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*IzBFChuxWCeF-WuXlMTz7A.png" /><figcaption>Image by the author.</figcaption></figure><p>As you can see the “this” reference is equal to the global object when the code is running outside of a function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCF_PDQOAwoxclFSbSXnJg.png" /><figcaption>Image by the author.</figcaption></figure><h4>So what is a global object?</h4><p>In JavaScript the global object will depend on where your code in running. In the browser this will be the “Window Object”, whereas in a node runtime this will be referred to as the global object.</p><blockquote>A global object is an object that always exists in the global scope <a href="https://developer.mozilla.org/en-US/docs/Glossary/Global_object">¹</a> . Any variable or function declared outside a function wrapper is by definition global.</blockquote><h4>So what is the “this” keyword ?</h4><blockquote>In most cases, the value of “this” is determined by how a function is called. It can&#39;t be set by assignment during execution, and it may be different each time the function is called. <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this">⁶</a></blockquote><p>In JavaScript the <em>“this”</em> keyword is just a reference given to a function execution context at runtime or in the global execution context <em>“this”</em> will be the global object such as the “window object” in the case of the browser.</p><p>The <em>“this”</em> reference is assigned by how and where the function was called from.</p><p>The keyword <em>“this”</em> can and will change often unexpectedly, <strong>however it does generally follow 4 rules which we will highlight below.</strong> <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md">²</a></p><p>We will not go into detail, however these rules follow an order of precedence, if multiple rules <em>could</em> apply to the call-site <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md">³</a>.</p><p>Priority 1 . Hard Binding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*rPG50pYlGsIAFNR8R5B1LA.png" /><figcaption>Image by the author.</figcaption></figure><p>Priority 2 Explicit Binding Rule — call or apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*E8F8FswtDyjgmXvX_vf14A.png" /><figcaption>Image by the author.</figcaption></figure><p>Priority 3 Implicit Binding rule</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANPxay3g0v7sg6CldcCW-g.png" /><figcaption>Image by the author.</figcaption></figure><p>Default Case : Normal functions in global scope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaXv2SFIJFxS6Qs22Gb0ow.png" /><figcaption>Image by the author.</figcaption></figure><p>Edge Cases</p><p>An edge case to these rules would be the “<em>fat arrow function</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*Ngbg7Bt9SvUGtnLSjZh_BA.png" /><figcaption>Image by the author.</figcaption></figure><blockquote>An arrow function does not have its own “this” . The “this” value of the enclosing lexical context is used.<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#No_separate_this">⁴</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*Pq3JcBTdjTnBEfJSu8Zr9g.png" /><figcaption>Image by the author.</figcaption></figure><p>Here we have a nested function which is referencing “this”. Here we dont get what we are expecting. In a nested function we lose our “this” reference to our object and the inner nested “this” now references not the object but the global object ??? Not what we were expecting!!</p><p>So how can fat arrow functions come to our rescue?</p><p>Until arrow functions, every new function defined had its own “<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this">this</a>” value (based on how the function was called). This proved to be less than ideal with an object-oriented style of programming.</p><p>An arrow function does not have its own “this” so the “this” value of the enclosing lexical context is used.</p><p>It will use the scope chain to identify the value of “this”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*oO2vY4XGPjlhWjoxiluXhw.png" /><figcaption>Image by the author.</figcaption></figure><p>Arrow function expressions are best suited for non-method functions, or you will lose reference to the objects “this” value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*T6Mc1EKSRDfqNFnaJKKXqw.png" /><figcaption>Image by the author.</figcaption></figure><h3>What is a Variable Object ?</h3><blockquote>A <em>variable object</em> is a <em>container of data</em> associated with the execution context. It’s a special object that stores <em>variables</em> and <em>function declarations</em> defined in the context.<a href="http://dmitrysoshnikov.com/ecmascript/javascript-the-core/">⁸</a></blockquote><p>In the global object this is often referred to as global context variable object (VO).[ video reference 1.1 below]. Later we will see a similar object that’s created during the function execution context. In a function it will be referred to as the function Activation Object (AO).<a href="http://dmitrysoshnikov.com/ecmascript/javascript-the-core/">⁸</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXL8Agk4EDi9X6XnTaFcOg.png" /><figcaption>Image by the author.</figcaption></figure><h4>What is the outer Environment ?</h4><p>The JavaScript engine will reference the functions Lexical Environment. This will depend on where that function or variable is written within the code. There are two Scopes it will be concerned with.</p><ol><li>The Global Scope</li><li>The function Scope.</li></ol><p>As the code is parsed during the creation phase the JavaScript engine will make a reference to all the variables outside of that function scope, and will determine that functions ability to access those variables should it need to through the scope chain.</p><p>It is here that will determine where the JavaScript engine should look if a variable is not available within that function.</p><p>It will search within its outer environment and move down its scope chain until it is found or if it reaches the end of its outer scope environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*dqt9L3i7XWKXVUq_AaHSOQ.png" /><figcaption>Image by the author.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*8Ra2FEjmnwn87q-rnO_29g.png" /><figcaption>Image by the author.</figcaption></figure><p>To understand how an function can reference its outer environment let&#39;s look at it from the follow perspective.</p><p>When a function is declared in your code that function, during the execution context, will be placed in memory. During that process as we discussed before, a variable or Activation object is created that contains variable references and properties. If a function declaration is placed in memory , that function in memory will have a property created, <strong><em>fn.[[scope]] </em></strong>, which will have a pointer back to its parent objects <strong><em>__parent__ property </em></strong>. That <strong><em>fn.[[scope]] property</em></strong> is a path back to its parents scope.<a href="http://dmitrysoshnikov.com/ecmascript/javascript-the-core/#scope-chain">⁸</a></p><p>Let&#39;s look at it from a visual perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pw2qc2zhLsyzvBwe0PPKJg.png" /><figcaption>Image by the author.</figcaption></figure><h4>What is Hoisting?</h4><p>Hoisting is a process undertaken by the JavaScript Engine during the creation phase of execution context. This Creates memory space for variables and functions and makes them available during their execution, even when they are referenced prior to their declaration. This is known as hoisting.</p><blockquote>The variables are not physically moved. They however act like the variables are placed at the top of the script, as they are scoped to the top, with an undeclared value of <strong><em>Undefined</em></strong>.</blockquote><p>The value of a variable is not assigned until the execution phase where the JavaScript engine parses the code line by line.<strong> <em>At this point all the engine is doing is performing a LHS ( left hand side ) lookup every time it sees a variable declaration or a function declaration</em>.</strong> It is however important to note that in the case of a function declaration that function is placed in memory and a pointer is set up so it can be run.</p><blockquote>In other words, an LHS look-up is done when a variable appears on the left-hand side of an assignment operation, and an RHS lookup is done when a variable appears on the right-hand side of an assignment operation.<a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md">⁵</a></blockquote><p>So if a variable is accessed before the code parses it in the execution phase it will return <strong>undefined</strong>. A function expression will also at this stage will just reference<strong> undefined and not the function itself, </strong>whereas<strong> </strong>a <strong><em>function declaration</em></strong> will execute if invoked as there is a pointer to a function in memory.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyVHRGWWZGUk&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyVHRGWWZGUk&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FyVHRGWWZGUk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4c99ce173c62d1a87fc20686378c608/href">https://medium.com/media/e4c99ce173c62d1a87fc20686378c608/href</a></iframe><p>So at this stage our Global creation phase has completed. We now have our global object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kzr6_jOGxgIsjwhGa9SaQ.png" /><figcaption>Image by the author.</figcaption></figure><p>The “this” keyword is pointing to the global object ( window in the browser or Global in Node ), and our outer environment scope has been set up. We have also undertaken hoisting of our variables and functions, however we have only performed a LHS lookup so no values have been assigned up until this point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCF_PDQOAwoxclFSbSXnJg.png" /><figcaption>Image by the author.</figcaption></figure><h3>So what happens now ?</h3><p>Now we move into the second phase of the execution context, the execution phase.</p><h3>The Execution Phase</h3><p>During the execution phase the compiler will parse the code top to bottom line by line. It will check each line and will perform a RHS (right hand side) lookup in its current scope for each assignment, and assign a value if found to the variable declaration. If no value is assigned it will remain “undefined”. These assignments will be added to the Global execution context<a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope">⁷</a> , and the global variable object.[see Image Reference 1.4]</p><h3>Function Invocations</h3><p>If a function invocation is found it will perform a RHS lookup to see if a variable by that name is a function and is in memory. Each time a function is invoked it will create a new function execution context for that function and place it on the call stack.</p><p>Once that function is placed on the call stack, that functions execution context is created. This follows a similar process to what we have seen with the creation of the global object.</p><p>There are again two phases.</p><ol><li>The creation phase.</li><li>The execution phase.</li></ol><p>During <strong>the creation phase</strong> we will see the creation of,</p><ol><li>The <em>“this” </em>keyword is defined.</li><li>A link to the Outer Environment is created.</li><li>The creation of the Activation Object.</li><li>Hoisting.</li></ol><p>It&#39;s important to note that each function creates its own execution context.</p><p>It will have a reference to its outer environment and access to its variable scope chain[see Image Reference 1.5 &amp; 1.6].</p><p>An Activation Object is created in the same way we saw earlier with the Global Variable Object. The significant difference with Activation objects is it also stores formal parameters and some arguments object.</p><p>Internal function scope is created and its internal variable and function declarations are hoisted inside the function wrapper.</p><p>During <strong>the function execution phase</strong> we will see,</p><p>The RHS lookup. If present a value will be assigned to the variable declaration.</p><p>If a function invocation is found the JavaScript engine will place that invoked function onto the execution stack and the process is again repeated [<em>see video Reference 1.2 </em>].</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnMOA8AzpruY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnMOA8AzpruY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnMOA8AzpruY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ee4428c20cd23439f9c47de6a2f0d21/href">https://medium.com/media/0ee4428c20cd23439f9c47de6a2f0d21/href</a></iframe><h3>Conclusion</h3><p>The Execution context has two stages. The creation of the “<em>Global Object execution context </em>”, and the creation of the “<em>function execution context</em>”. Each process is split into two stages. First the “<em>creation phase</em>” and secondly the “<em>execution phase</em>”.</p><p>The creation phase is responsible for the creation of the “<em>this</em>” reference, the creation of the outer environment references, the creation of a variable/activation object as well as hoisting. Hoisting will perform a <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope">LHS lookup</a> and allocate variable memory space. The value at this stage will be Undefined as allocated by the JavaScript engine. A <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope">RHS lookup</a> (the value assignment) is not undertaken until the execution phase.</p><p>The execution phase is responsible for the execution of code. This also involves the allocation of values to variables through<a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope"> RHS lookup</a>. If no value is assigned then the variable will be assigned a value of undefined by the JavaScript engine.<a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope">⁷</a></p><p>Once a return statement is parsed the function is popped off the execution stack. Once all functions have completed and all code has been executed in the global execution context, the call stack will complete and will be emptied.</p><p>Please refer to the references included within this article for a more detailed explanation of the key concepts covered. A reference list is also included below as well as Recommended Learning Material<em> </em>for further contextual information.</p><p><em>Contact Details</em></p><ul><li><a href="https://www.linkedin.com/in/letuscode/">Jason Williams - JavaScript Engineer - letuscode.co.uk | LinkedIn</a></li><li><a href="https://github.com/jwill9999">jwill9999 - Overview</a></li></ul><p><em>References</em></p><p><em>[1]</em><a href="https://developer.mozilla.org/en-US/docs/Glossary/Global_object"><em> MDN The Global Object</em></a></p><p>[2], [3] <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md">You dont know JavaScript, This and object prototypes, Chapter 2, by Kyle Simpson 2014</a>.</p><p>[4] <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#No_separate_this">MDM web docs, Arrow functions 2019</a></p><p>[5] <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md">You Don’t Know JavaScript, Scopes and Closures Kyle Simpson 2014</a></p><p>[6] <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this">MDN this JavaScript</a></p><p>[7] <a href="https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20%26%20closures/ch1.md#understanding-scope">You-Dont-Know-JS Understanding Scope , Kyle Simpson 2014</a></p><p>[8] <a href="http://dmitrysoshnikov.com/ecmascript/javascript-the-core/">JavaScript Core, Dmitry Soshnikov, 2010</a></p><p><em>Recommended Learning Material</em></p><ol><li><a href="https://github.com/getify/You-Dont-Know-JS">You Don&#39;t Know JavaScript</a>. Complete free list of online books by Kylie Simpson about JavaScript.</li><li><a href="https://www.youtube.com/watch?v=6MXRNXXgP_0">Philip Roberts Help I’m stuck in an event loop</a>.</li><li><a href="https://www.youtube.com/watch?v=Fg7niTmNNLg">Marja Hölttä: Parsing JavaScript — better lazy than eager? | JSConf EU 2017</a></li><li><a href="https://www.youtube.com/watch?v=Bv_5Zv5c-Ts&amp;t=28s">JavaScript: Understanding the Weird Parts</a></li><li><a href="https://youtu.be/cCOL7MC4Pl0">Jake Archibald: In The Loop — JSConf.Asia 2018</a></li><li><a href="https://youtu.be/p-iiEDtpy6I">Franziska Hinkelmann: JavaScript engines — how do they even? | JSConf EU 2017</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e59e011873a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>