Sunday, 2 November 2025

Functional Scaffolding for Agentic LLM Solutions

 

Slingshot Your Way to Secure, Efficient AI solutions

I have always been fascinated by the ellipse-trail manoeuvres of a gravity-assisted slingshot in rocketry. Somehow it feels comparable to how we reach our goals in the AI-solution world, moving from a start point to a target destination.

https://www.scientificamerican.com/article/how-does-a-gravitational-slingshot-work/

A schematic illustration of the solar system, showing an interplanetary trajectory utilizing a gravitational assist maneuver.

A gravitational slingshot leverages every planet in its path — using each body’s gravity to gain momentum (saving fuel in the process) — until the spacecraft is flung toward its destination. The starting point is analogous to our problem statement, and the destination is the target state we wish to achieve with AI Agents. The smarter the agents, the greater the efficiency, the less compute “fuel” burned, and the faster we reach the final solution.
At first, I was fascinated with how a newer model can eliminate so much code and iteration in your agents. Then the more I dug into the code, the more it became clear that every “pass” at an LLM can actually be broken down better — either into multiple passes or via logical checkpoints — which I refer to as a functional scaffold. This scaffold supports the final outcome and can also optimise efficiency.
For example — if you look at the checkpoints in a flow for math chapters (note: this is not an agentic AI flow, but simply a way to highlight scaffold-layers):

Math-Specific Layers

Layer

Purpose

Example

Confidence Impact

Concept Match

Identify formula type

“Area calculation → πr²”

+25%

Formula Apply

Execute calculation

“π × 5² = 25π”

+30%

Step Validate

Check each operation

“25π ≈ 78.54”

+25%

Answer Verify

Reasonableness check

“~79 cm² reasonable for r=5”

+18.6%

Total Math Confidence: 98.6%

 

Science-Specific Layers

Layer

Purpose

Example

Confidence Impact

Concept Match

Scientific principle

“Acid + Base → Neutralization”

+20%

Principle Apply

Core mechanism

“H⁺ + OH⁻ → H₂O”

+20%

Context Link

Real-world connection

“Stomach acid + antacid”

+20%

Cross-Concept

Multi-principle integration

“pH + Salt formation”

+20%

Synthesis

Holistic understanding

“Complete reaction overview”

+15%

Total Science Confidence: 95%

 

It’s worth noting that most commercial LLMs do not give you full insight into their internal activations or operations. As of this writing, typical application developers have access to chat/completion endpoints, embeddings, and fine-tuning, but not raw hidden states or full layer-wise activations.

Without visibility into how the model formed its reasoning, we cannot safely assume a single pass will result in a correct or explainable answer. By architecting a multi-pass scaffold (concept check → tool call → validation → final synthesis) we overlay structured checkpoints on top of the opaque core, thus improving confidence, traceability and security.”

Observed Constraint

Implication for Agent Design

Scaffold Response

Hidden states not exposed (e.g., no layer-wise activations)

Limited introspection / difficult tracing of internal reasoning

Introduce validation layer: intermediate “why”-checks, tool invocation logs, state snapshots

Single large prompt → output

Risk of error propagation without checkpoints

Break task into smaller passes, each with a purpose (concept match, apply, validate…)

Model behaviour may vary / unknown

Hard to guarantee correctness or controllability

Use scaffold architecture to impose governance: checkpoints, tool boundaries, human-in-loop where needed

 

These constraints strongly reinforce the need for structuring internal workflow via scaffold rather than relying on a monolithic prompt, or even an ‘Agentic’ architecture.

Bridging to Agentic Architecture: Why Scaffolding Still Matters

When your architecture evolves into a truly agentic system — where the underlying model not only responds to prompts but decides on tools, sequences, sub-agents and logic flows — the notion of functional scaffolding doesn’t vanish. In fact, it becomes even more essential.
Agentic systems (or “multi-agent” systems) are defined by autonomous agents that perceive, reason, plan, act, communicate and delegate within complex workflows. Because of this autonomy, the degree of unpredictability and the potential for error increase significantly. And since the core model remains a black box — hidden states and internal reasoning remain inaccessible to most developers — we cannot simply hand off the task and hope for the best.

That’s exactly where the functional scaffold steps in. By embedding structured checkpoints, validation layers and oversight boundaries around agentic flows, you ensure that autonomy does not turn into errant behaviour, drift, or uncontrollable complexity. Consider a typical agentic sequence: the system decomposes the goal into subtasks, selects tools, hands off to sub-agents, aggregates outputs, synthesises results and returns a final answer. At each of these junctures there is an autonomous decision being made — and without scaffolding you risk incorrect subtask decomposition, wrong tool calls, uncontrolled cascades or hallucinations.

Here’s how the scaffold maps to agentic stages:

Agentic Stage

Autonomy & Risk Snapshot

Scaffold Response

Task decomposition & plan generation

Agent chooses subtasks and order

Decomposition checkpoint: agent explains plan → review

Tool/sub-agent invocation

Agent selects tools or sub-agents

Tool-choice validation: confirm tool appropriateness

Sub-agent execution & output

Sub-agent acts with limited supervision

Output validation layer: verify result correctness

Final synthesis & decision

Agent aggregates and presents answer

Final verify: check alignment, completeness, reasonableness

Even when the underlying model appears intelligent enough to “figure things out,” you simply cannot rely on opaque internal states. As many enterprise observers note, agentic AI introduces new observability, governance and monitoring burdens. Without checkpoints, you are essentially trusting your system blindly. With scaffolding, you maintain control and traceability.

In the gravitational slingshot metaphor, you might be tempted to simply “fire the agent” and let inertia carry it home. But as your solution becomes agentic — with multiple bodies, interactions and decision-points — you definitely need mid-course corrections, validation orbits and safe checkpoints. The functional scaffold becomes those control-points that steer, correct and validate the trajectory when the “mass” you’re launching is far more complex than a single monolithic model.

Summary

Agentic systems don’t remove the need for scaffolding—they amplify it. The more autonomy, tools and agents we allow, the more governance, validation and structured scaffolding we must embed to ensure reliability, security, traceability and efficiency.

Key Focus Areas

  • Decompose workflows into discrete passes that can be validated (and which may in some cases require human intervention).
  • Embed “mini-checkpoints” — not only for audit trails, but to gain deeper insight into how largely black-box models behave from the perspective of an application developer.
  • Build observability and security checkpoints on top of those mini-checkpoints, so your AI solutions remain granular, fine-grained and auditable.

 

 

Saturday, 20 September 2025

Published: End-user responsibilities on a Generative AI conversation, at RDV - one of the leading journals on data protection law

Pleased to share that my article was published on the RDV journal: On the role of an end-user in handling a Generative-AI powered application, particularly the high-risk ones as categorized by the EU AI regulation. 

End-user responsibilities on a Generative AI conversation

Snapshot from the article



Published: Navigating the Legal Landscape for GPAI in EuDIR

Pleased to share that my article, “Navigating the legal landscape for GPAI – a bottom-up view,” has been published in the latest issue of EuDIR – Zeitschrift für Europäisches Daten- und Informationsrecht.

About the Article:
The article explores the evolving legal framework for general purpose AI (GPAI) from a practical perspective, focusing on the roles and responsibilities of key stakeholders in the AI ecosystem.

https://www.nomos-shop.de/de/p/eudir-zeitschrift-fuer-europaeisches-daten-und-informationsrecht-2944-4551

Excerpts (German Introduction) and a snapshot from the Article 





Monday, 15 September 2025

The GPT-5 impact!

 Introduction

Chat GPT happened. A host of models happened. Improvements continue to come out at an accelerated pace. Focus of this small little article is to see if we can keep pace with our designs and remain both efficient and relevant to the latest and greatest. 

I don't have a host of Elo benchmarks and ratings to evaluate these models. All I have is a small little design for solving Math and Science problems - that has generally kept me honest and grounded, whether it was in using Cursor or Windsurf or lately, Github CoPilot to write code, or in the choice of models (GPT-4o was clearly my favorite up until today!). 

Evolution

Every other weekend, this below design kept improving while the focus was almost always to basically read up Math (and Science) chapters, keep the concepts handy, solve Q&A papers and keep the correlation with what is taught in the books (using the concepts). 

My design evolved - with GPT-4o- but wasn't very Agentic till this point. I had the concept of 'Engine' carved out here to basically perform a more deterministic set of operations and then an Orchestrator that managed it all. 

The first and significant change I noticed with GPT-5 was it's ability to draw geometric diagrams and solve quadratic equations much better than it's predecessors. That said, I did want some level of validation and deterministic capabilities with my tools and ended up re-evaluating the design at a tooling level on the following lines. 

Early days yet - but as you can see above - am giving myself the headroom to slowly wean off the current volume of 'tools' in a staggered manner - on these lines. 

1. Move the obvious ones out- such as extracting the geometric specifications, creating an equation can simply be moved out. 

2. Hold the deterministic ones for now - such as validating the coefficients of a solved equation; applying the right scale to a trigonometric diagram; staying withing the bounds of what was taught by the 'concepts' originally sourced from the textbook, etc. 

3.  Plan for the more complex questions - those that pan across Chapters, concepts are yet to be fully tested; but given all the Math and Science benchmarks scaled by GPT-5, am hoping that solving a Composite question paper should slowly become easier and better with this alternative. 

Before we move onto the Agentic alternative, let us have a snapshot of the current solution's performance.                                                 

ChapterItemsMean scoreacceptsrate%
Chapter7- Coordinate Geometry334.67310.9493.9
Chapter8- Trigonometry364.56290.8180.6
Chapter9- ApplyingTrigonometry164.38110.6968.8
Chapter10- Circles174.76150.8888.2

The current code flow is captured in this mindmap. 

 

Step 1 in the evolution- Agentic with GPT-4o 

As a logical first step, I created the Agentic approach with the same model used above; just to get an apples to apples comparison due to the design change. The approach could be abstracted as shown below. 

The new found autonomy with the Agents makes them run around a solution from identifying the right concept -> right solution -> a final evaluation with a little more freedom than before. Core components of the solution that could be reused in the form parsing engines, tools have been taken forward, naturally. 

The evaluation of the responses across 20 questions, 5 from each of the 4 chapters was based on the following factors. 

Evaluation Matrix

Evaluation DimensionCriteriaScore RangeWeight
Mathematical CorrectnessFinal answer accuracy and computational precision0-5Primary
Solution ApproachAppropriateness and efficiency of chosen method0-5Primary
Step-by-Step ClarityLogical progression and explanation quality0-5Secondary
Formula ApplicationCorrect identification and usage of relevant formulas0-5Secondary
Concept IntegrationConnection to underlying mathematical principles0-5Tertiary

Step 2 - GPT-5 for the same questions! 

The approach with GPT-5 was on the below lines. There was clear reduction in the volume of code and conditions that went into Orchestration. 

Evaluation Results:

StageScoreImprovement
Stage 1 - Engine led 4.50/5Baseline
Stage 2 - Agentic (GPT-4o)4.55/5+1.1%
Stage 3 - Agentic (GPT-5)*4.65/5+3.3%

*Honestly, I expected GPT-5 to get all 20 questions right to the T!  

Other Changes brought forward by this design 

Reduced codebase: with GPT-5 handling a wider range of deterministic and probabilistic steps internally, I could retire several helper scripts (especially around parsing and equation validation).

Cleaner orchestration: fewer calls to external “tools” meant the Orchestrator’s job became more supervisory than managerial.

Better resilience: GPT-5 was able to recover from missteps in intermediate steps (e.g., mis-labeled equations, incomplete geometric specifications) without needing my fallback validation engines every time.

Summary

We’re all told that change is constant — but in the LLM / GPT-powered world, that change comes with acceleration. The velocity of improvements means that even code written just a few months ago can feel redundant today.

My next step is to expand this analysis across all chapters and question types, not just the sampled set. If the improvement trends I’ve seen with GPT-5 hold up, I’ll share the results in a follow-up post. The main lesson so far: stay ready to experiment, and be willing to rethink even the core of a design — provided the model and use case allow for it.


Closing Thoughts

For this entire journey — from design through implementation — I leaned on GitHub Copilot Chat and agent assistants. I haven’t benchmarked the underlying models across tools like Windsurf or Cursor in a structured way, but one observation stood out: Claude Sonnet 4 seemed to handle large context windows more reliably than most. In practice, this meant fewer iteration errors when working in its “agent” mode.

It’s early days still, but the direction is clear: as models keep evolving, so must our designs.

Functional Scaffolding for Agentic LLM Solutions

  Slingshot Your Way to Secure, Efficient AI solutions I have always been fascinated by the ellipse-trail manoeuvres of a gravity-assisted...