<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ritesh Kumar</title>
    <description>The latest articles on Forem by Ritesh Kumar (@riteshkmr).</description>
    <link>https://forem.com/riteshkmr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3878899%2F12e82869-49f7-43b4-bda9-49b590e30f7b.jpeg</url>
      <title>Forem: Ritesh Kumar</title>
      <link>https://forem.com/riteshkmr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/riteshkmr"/>
    <language>en</language>
    <item>
      <title>Title: How to add a governance layer to your LangChain agent in 3 lines</title>
      <dc:creator>Ritesh Kumar</dc:creator>
      <pubDate>Thu, 16 Apr 2026 21:21:59 +0000</pubDate>
      <link>https://forem.com/riteshkmr/title-how-to-add-a-governance-layer-to-your-langchain-agent-in-3-lines-58eo</link>
      <guid>https://forem.com/riteshkmr/title-how-to-add-a-governance-layer-to-your-langchain-agent-in-3-lines-58eo</guid>
      <description>&lt;p&gt;Every tutorial shows you how to build &lt;br&gt;
an AI agent.&lt;/p&gt;

&lt;p&gt;Nobody shows you what happens when it &lt;br&gt;
does something it shouldn't.&lt;/p&gt;

&lt;p&gt;Your agent approves a payment it wasn't &lt;br&gt;
supposed to. Calls an API with wrong &lt;br&gt;
parameters. Executes an action outside &lt;br&gt;
its mandate.&lt;/p&gt;

&lt;p&gt;No audit trail. No explanation. No way &lt;br&gt;
to prove what happened.&lt;/p&gt;

&lt;p&gt;This post shows you how to fix that &lt;br&gt;
in 3 lines of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;When your AI agent takes a real-world &lt;br&gt;
action — payment, approval, data export &lt;br&gt;
— two things need to happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Someone needs to decide if the action 
is allowed&lt;/li&gt;
&lt;li&gt;That decision needs to be recorded 
permanently&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most agent frameworks give you neither.&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;SOVIGL is a policy enforcement layer &lt;br&gt;
that sits between your agent and the &lt;br&gt;
action it wants to take.&lt;/p&gt;

&lt;p&gt;One call. Three outcomes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;approved — action executes&lt;/li&gt;
&lt;li&gt;pending — held for human approval&lt;/li&gt;
&lt;li&gt;blocked — stopped permanently&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every outcome is permanently recorded &lt;br&gt;
with a decision ID, plain English &lt;br&gt;
explanation, risk score, and policy &lt;br&gt;
version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;pip install sovigl&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic usage
&lt;/h2&gt;

&lt;p&gt;import sovigl&lt;/p&gt;

&lt;p&gt;sovigl.configure(&lt;br&gt;
    api_key="your-key",&lt;br&gt;
    org_id="your-org"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;decision = sovigl.evaluate(&lt;br&gt;
    action="payment.create",&lt;br&gt;
    context={&lt;br&gt;
        "amount": 5000,&lt;br&gt;
        "role": "employee",&lt;br&gt;
        "user_id": "user_123",&lt;br&gt;
        "agent_id": "invoice_bot"&lt;br&gt;
    }&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;if decision.approved:&lt;br&gt;
    execute_payment()&lt;br&gt;
elif decision.pending:&lt;br&gt;
    route_to_human_approver()&lt;br&gt;
elif decision.blocked:&lt;br&gt;
    log_and_stop()&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get back
&lt;/h2&gt;

&lt;p&gt;Every decision returns:&lt;/p&gt;

&lt;p&gt;decision.status          # approved/pending/blocked&lt;br&gt;
decision.decision_id     # permanent immutable ID&lt;br&gt;
decision.reason          # why this decision was made&lt;br&gt;
decision.explanation_registry  # full explainability&lt;br&gt;
decision.risk_assessment # risk score 0.0-1.0&lt;br&gt;
decision.policy_version  # which policy was active&lt;br&gt;
decision.approval_id     # human approval reference&lt;/p&gt;

&lt;h2&gt;
  
  
  LangChain integration
&lt;/h2&gt;

&lt;p&gt;from langchain.agents import AgentExecutor&lt;br&gt;
import sovigl&lt;/p&gt;

&lt;p&gt;sovigl.configure(api_key="your-key", org_id="your-org")&lt;/p&gt;

&lt;p&gt;def governed_payment(amount: float, role: str) -&amp;gt; str:&lt;br&gt;
    decision = sovigl.evaluate(&lt;br&gt;
        action="payment.create",&lt;br&gt;
        context={"amount": amount, "role": role}&lt;br&gt;
    )&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if decision.approved:&lt;br&gt;
    return f"Payment approved. Audit ID: {decision.decision_id}"&lt;br&gt;
elif decision.pending:&lt;br&gt;
    return f"Payment held for approval. ID: {decision.approval_id}"&lt;br&gt;
else:&lt;br&gt;
    return f"Payment blocked. Reason: {decision.reason}"&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Use as a LangChain tool&lt;br&gt;
&lt;/h1&gt;

&lt;p&gt;from langchain.tools import tool&lt;/p&gt;

&lt;p&gt;@tool&lt;br&gt;
def process_payment(amount: float, role: str) -&amp;gt; str:&lt;br&gt;
    """Process a payment with governance."""&lt;br&gt;
    return governed_payment(amount, role)&lt;/p&gt;

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

&lt;p&gt;Every decision automatically produces &lt;br&gt;
evidence for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EU AI Act Art.12 — audit trail&lt;/li&gt;
&lt;li&gt;EU AI Act Art.13 — explainability
&lt;/li&gt;
&lt;li&gt;EU AI Act Art.14 — human oversight&lt;/li&gt;
&lt;li&gt;NIST AI RMF — govern and measure&lt;/li&gt;
&lt;li&gt;MAS FEAT — accountability&lt;/li&gt;
&lt;li&gt;RBI FREE-AI — REC21 + REC24&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not claims. Structured evidence in every &lt;br&gt;
API response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it now
&lt;/h2&gt;

&lt;p&gt;Demo works with no API key:&lt;/p&gt;

&lt;p&gt;import sovigl&lt;/p&gt;

&lt;p&gt;decision = sovigl.evaluate(&lt;br&gt;
    action="payment.create",&lt;br&gt;
    context={"amount": 5000}&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(decision.status)&lt;br&gt;
print(decision.decision_id)&lt;br&gt;
print(decision.reason)&lt;/p&gt;

&lt;p&gt;Live dashboard — no signup:&lt;br&gt;
&lt;a href="https://web-production-e334b.up.railway.app/dashboard" rel="noopener noreferrer"&gt;https://web-production-e334b.up.railway.app/dashboard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/riteshkumar10000/sovigl-sdk" rel="noopener noreferrer"&gt;https://github.com/riteshkumar10000/sovigl-sdk&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;If you're building agents that take &lt;br&gt;
real-world actions — payments, approvals, &lt;br&gt;
data operations — SOVIGL gives you &lt;br&gt;
governance without rebuilding your &lt;br&gt;
agent architecture.&lt;/p&gt;

&lt;p&gt;Free during beta. No credit card.&lt;/p&gt;

&lt;p&gt;Questions in the comments — happy to help.&lt;/p&gt;

</description>
      <category>python</category>
      <category>langchain</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Your approval logic is a future audit problem</title>
      <dc:creator>Ritesh Kumar</dc:creator>
      <pubDate>Tue, 14 Apr 2026 16:11:29 +0000</pubDate>
      <link>https://forem.com/riteshkmr/your-approval-logic-is-a-future-audit-problem-ec0</link>
      <guid>https://forem.com/riteshkmr/your-approval-logic-is-a-future-audit-problem-ec0</guid>
      <description>&lt;p&gt;If your system has this:&lt;/p&gt;

&lt;p&gt;if amount &amp;gt; 10000:&lt;br&gt;
    require_approval()&lt;br&gt;
elif amount &amp;lt; 1000:&lt;br&gt;
    approve()&lt;br&gt;
else:&lt;br&gt;
    send_to_manager()&lt;/p&gt;

&lt;p&gt;You don't have logic.&lt;br&gt;
You have a future audit problem.&lt;/p&gt;

&lt;p&gt;Every approval system built this way eventually becomes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;untraceable&lt;/li&gt;
&lt;li&gt;impossible to explain&lt;/li&gt;
&lt;li&gt;a nightmare when compliance shows up&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Auditors don't ask "does it work?"&lt;br&gt;
They ask "why was this specific transaction approved &lt;br&gt;
on March 3rd at 2pm by this agent?"&lt;/p&gt;

&lt;p&gt;If your answer is "let me check the code" —&lt;br&gt;
you've already lost.&lt;/p&gt;




&lt;p&gt;I built a gate that sits between intent and execution:&lt;/p&gt;

&lt;p&gt;pip install sovigl&lt;/p&gt;

&lt;p&gt;import sovigl&lt;/p&gt;

&lt;p&gt;decision = sovigl.evaluate(&lt;br&gt;
    action="expense.submit",&lt;br&gt;
    context={&lt;br&gt;
        "amount": 5000,&lt;br&gt;
        "employee_id": "E123"&lt;br&gt;
    }&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(decision.status)  # approved / pending / blocked&lt;/p&gt;

&lt;p&gt;That's the entire integration.&lt;/p&gt;




&lt;p&gt;What you get back on every single call:&lt;/p&gt;

&lt;p&gt;decision.status        # approved / pending / blocked&lt;br&gt;
decision.reason        # why this decision was made&lt;br&gt;
decision.decision_id   # permanent unique reference&lt;br&gt;
decision.approval_id   # present when human review needed&lt;br&gt;
decision.cdt           # full decision metadata&lt;/p&gt;

&lt;p&gt;Not logs you write yourself.&lt;br&gt;
Not comments in the code.&lt;br&gt;
Structured, tamper-proof, permanent.&lt;/p&gt;




&lt;p&gt;The three outcomes:&lt;/p&gt;

&lt;p&gt;500    → approved  (within policy, executes immediately)&lt;br&gt;
5000   → pending   (routes to human approver, waits)&lt;br&gt;
100000 → blocked   (policy violation, hard stop)&lt;/p&gt;

&lt;p&gt;if decision.approved:&lt;br&gt;
    execute()&lt;br&gt;
elif decision.pending:&lt;br&gt;
    notify_approver(decision.approval_id)&lt;br&gt;
elif decision.blocked:&lt;br&gt;
    raise PolicyViolation(decision.reason)&lt;/p&gt;




&lt;p&gt;Why this matters especially for AI agents:&lt;/p&gt;

&lt;p&gt;AI agents don't pause. They execute at machine speed.&lt;/p&gt;

&lt;p&gt;Without a gate, a misconfigured agent — or a prompt&lt;br&gt;
injection attack — can approve transactions before&lt;br&gt;
any human sees them.&lt;/p&gt;

&lt;p&gt;SOVIGL sits between the agent's intent and execution.&lt;br&gt;
The agent decides what to do.&lt;br&gt;
SOVIGL decides if it's allowed to.&lt;/p&gt;




&lt;p&gt;Every decision automatically satisfies:&lt;/p&gt;

&lt;p&gt;🇪🇺 EU AI Act — Art. 9, 12, 13, 14&lt;br&gt;
🇸🇬 MAS FEAT — Accountability, Traceability, Transparency&lt;br&gt;
🇺🇸 NIST AI RMF — Govern, Measure, Manage, Monitor&lt;br&gt;
🇮🇳 RBI FREE-AI — Rec 04, 07, 11, 12, 16, 18, 21, 24, 26&lt;/p&gt;

&lt;p&gt;Not claims. Live verified controls.&lt;br&gt;
See the proof:&lt;br&gt;
&lt;a href="https://web-production-e334b.up.railway.app/dashboard" rel="noopener noreferrer"&gt;https://web-production-e334b.up.railway.app/dashboard&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Works in Node too:&lt;/p&gt;

&lt;p&gt;const sovigl = require("sovigl");&lt;/p&gt;

&lt;p&gt;const decision = await sovigl.evaluate({&lt;br&gt;
    action: "expense.submit",&lt;br&gt;
    context: { amount: 5000, employee_id: "E123" }&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;console.log(decision.status);&lt;/p&gt;




&lt;p&gt;pip install sovigl&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/riteshkumar10000/sovigl-sdk" rel="noopener noreferrer"&gt;https://github.com/riteshkumar10000/sovigl-sdk&lt;/a&gt;&lt;br&gt;
Early access for production: &lt;a href="mailto:sovigl100@gmail.com"&gt;sovigl100@gmail.com&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;How are you handling approval logic today?&lt;br&gt;
Still if/else? A rules engine? Something else?&lt;/p&gt;

&lt;p&gt;Genuinely curious.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
