<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Faadil Boussari</title>
    <description>The latest articles on DEV Community by Faadil Boussari (@faadil_boussari_78f216133).</description>
    <link>https://dev.to/faadil_boussari_78f216133</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4048616%2F26a7bf15-7707-4c90-8db3-7eb8e934d366.png</url>
      <title>DEV Community: Faadil Boussari</title>
      <link>https://dev.to/faadil_boussari_78f216133</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/faadil_boussari_78f216133"/>
    <language>en</language>
    <item>
      <title>The Payment Succeeded. The Governance Failed: Observing AI Agent Boundary Violations with OpenTelemetry and SigNoz</title>
      <dc:creator>Faadil Boussari</dc:creator>
      <pubDate>Mon, 27 Jul 2026 03:36:29 +0000</pubDate>
      <link>https://dev.to/faadil_boussari_78f216133/the-payment-succeeded-the-governance-failed-observing-ai-agent-boundary-violations-with-186n</link>
      <guid>https://dev.to/faadil_boussari_78f216133/the-payment-succeeded-the-governance-failed-observing-ai-agent-boundary-violations-with-186n</guid>
      <description>&lt;p&gt;AI agents are increasingly being trusted with actions that affect money, permissions, customer data, and operational systems.&lt;/p&gt;

&lt;p&gt;But there is a dangerous assumption hidden inside many agent workflows:&lt;/p&gt;

&lt;p&gt;If the action completed successfully, the agent behaved correctly.&lt;/p&gt;

&lt;p&gt;That is not always true.&lt;/p&gt;

&lt;p&gt;A payment can succeed technically while violating an approval policy. An API call can return 200 OK while crossing a governance boundary. A workflow can complete exactly as requested and still be unsafe.&lt;/p&gt;

&lt;p&gt;I built Second Signature for the Agents of SigNoz hackathon to explore that distinction.&lt;/p&gt;

&lt;p&gt;Second Signature is an observability system for high-risk actions performed by AI agents. It reconstructs the complete path from intent to policy evaluation, approval, payment execution, and ledger impact.&lt;/p&gt;

&lt;p&gt;The core idea is simple:&lt;/p&gt;

&lt;p&gt;Execution success is not governance success.&lt;/p&gt;

&lt;p&gt;The scenario&lt;/p&gt;

&lt;p&gt;The demo uses one controlled financial scenario:&lt;/p&gt;

&lt;p&gt;Operation: refund&lt;br&gt;
Amount: CAD 12,500&lt;br&gt;
Beneficiary: Northstar Vendor&lt;br&gt;
Beneficiary status: new&lt;br&gt;
Reason: contract dispute&lt;/p&gt;

&lt;p&gt;The policy is:&lt;/p&gt;

&lt;p&gt;Transfers above CAD 5,000 to a new beneficiary require human approval.&lt;/p&gt;

&lt;p&gt;The project compares three outcomes from the same request.&lt;/p&gt;

&lt;p&gt;Outcome 1: Unsafe success&lt;/p&gt;

&lt;p&gt;A legacy agent executes the payment without obtaining the required approval.&lt;/p&gt;

&lt;p&gt;The payment succeeds, the ledger changes, and only afterward does the policy audit record that the action should have required approval.&lt;/p&gt;

&lt;p&gt;Outcome 2: Safe stop&lt;/p&gt;

&lt;p&gt;A guarded agent evaluates the policy, requests approval, receives a rejection, and blocks the payment.&lt;/p&gt;

&lt;p&gt;The ledger remains unchanged.&lt;/p&gt;

&lt;p&gt;Outcome 3: Safe success&lt;/p&gt;

&lt;p&gt;A guarded agent evaluates the policy, requests approval, receives approval from FINANCE_LEAD, and only then executes the payment.&lt;/p&gt;

&lt;p&gt;The same financial action becomes valid because the required second signature exists.&lt;/p&gt;

&lt;p&gt;What Second Signature does&lt;/p&gt;

&lt;p&gt;Second Signature separates three responsibilities clearly:&lt;/p&gt;

&lt;p&gt;The application guard enforces the policy.&lt;br&gt;
OpenTelemetry emits the evidence.&lt;br&gt;
SigNoz observes, queries, audits, and alerts.&lt;/p&gt;

&lt;p&gt;SigNoz does not approve or block the payment directly. The application guard performs enforcement.&lt;/p&gt;

&lt;p&gt;SigNoz provides the observability layer that makes each decision path visible and auditable.&lt;/p&gt;

&lt;p&gt;The project uses:&lt;/p&gt;

&lt;p&gt;TypeScript and Node.js&lt;br&gt;
The official OpenTelemetry Node.js SDK&lt;br&gt;
OTLP over HTTP/protobuf&lt;br&gt;
SigNoz Cloud&lt;br&gt;
Custom traces and metrics&lt;br&gt;
Trace-based alerting&lt;br&gt;
Foundry configuration for reproducibility&lt;br&gt;
A static Vercel deployment for the judge-facing demo&lt;/p&gt;

&lt;p&gt;The ledger in the demo is controlled in-memory application state. It exists to prove whether the simulated financial side effect occurred. This is not a production banking integration and no real money is moved.&lt;/p&gt;

&lt;p&gt;Designing telemetry around business meaning&lt;/p&gt;

&lt;p&gt;A normal observability setup often focuses on technical signals:&lt;/p&gt;

&lt;p&gt;latency&lt;br&gt;
errors&lt;br&gt;
throughput&lt;br&gt;
CPU&lt;br&gt;
memory&lt;br&gt;
HTTP status codes&lt;/p&gt;

&lt;p&gt;Those signals are important, but they do not answer the central question in this project:&lt;/p&gt;

&lt;p&gt;Was the agent allowed to perform the action?&lt;/p&gt;

&lt;p&gt;To answer that, I added domain-specific attributes to the traces.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;p&gt;agent.variant&lt;br&gt;
policy.name&lt;br&gt;
policy.mode&lt;br&gt;
policy.matched&lt;br&gt;
approval.required&lt;br&gt;
approval.status&lt;br&gt;
approval.approver&lt;br&gt;
payment.executed&lt;br&gt;
payment.amount&lt;br&gt;
payment.currency&lt;br&gt;
governance.outcome&lt;/p&gt;

&lt;p&gt;This makes it possible to investigate both technical execution and governance correctness.&lt;/p&gt;

&lt;p&gt;For example, an action can have:&lt;/p&gt;

&lt;p&gt;payment.executed = true&lt;br&gt;
approval.required = true&lt;br&gt;
approval.status = missing&lt;br&gt;
governance.outcome = unsafe_success&lt;/p&gt;

&lt;p&gt;Technically, the payment completed.&lt;/p&gt;

&lt;p&gt;From a governance perspective, it failed.&lt;/p&gt;

&lt;p&gt;The three trace structures&lt;/p&gt;

&lt;p&gt;Each scenario produces one root trace with nested spans that preserve the chain of causality.&lt;/p&gt;

&lt;p&gt;Unsafe success&lt;br&gt;
second_signature.run&lt;br&gt;
└── agent.request&lt;br&gt;
    ├── payment.transfer&lt;br&gt;
    └── policy.audit&lt;/p&gt;

&lt;p&gt;The critical fact is the order:&lt;/p&gt;

&lt;p&gt;payment.transfer&lt;br&gt;
before&lt;br&gt;
policy.audit&lt;/p&gt;

&lt;p&gt;The legacy agent executes first. The policy audit records the violation afterward.&lt;/p&gt;

&lt;p&gt;The relevant attributes include:&lt;/p&gt;

&lt;p&gt;agent.variant = legacy&lt;br&gt;
policy.matched = true&lt;br&gt;
policy.mode = observe_only&lt;br&gt;
approval.required = true&lt;br&gt;
approval.status = missing&lt;br&gt;
payment.executed = true&lt;br&gt;
payment.amount = 12500&lt;br&gt;
payment.currency = CAD&lt;br&gt;
governance.outcome = unsafe_success&lt;/p&gt;

&lt;p&gt;This is the most important failure mode in the project.&lt;/p&gt;

&lt;p&gt;The agent appears successful because the refund completed, but the approval boundary was violated.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: unsafe trace waterfall showing payment.transfer before policy.audit]&lt;/p&gt;

&lt;p&gt;Safe stop&lt;br&gt;
second_signature.run&lt;br&gt;
└── agent.intent.transfer&lt;br&gt;
    └── policy.evaluate&lt;br&gt;
        └── approval.request&lt;br&gt;
            └── payment.blocked&lt;/p&gt;

&lt;p&gt;The guarded agent recognizes the policy before execution.&lt;/p&gt;

&lt;p&gt;The approval is rejected, so the payment is blocked.&lt;/p&gt;

&lt;p&gt;Relevant attributes include:&lt;/p&gt;

&lt;p&gt;agent.variant = guarded&lt;br&gt;
approval.required = true&lt;br&gt;
approval.status = rejected&lt;br&gt;
payment.executed = false&lt;br&gt;
payment.amount = 0&lt;br&gt;
governance.outcome = safe_stop&lt;/p&gt;

&lt;p&gt;The ledger remains:&lt;/p&gt;

&lt;p&gt;CAD 50,000&lt;/p&gt;

&lt;p&gt;The key result is not an error. It is a safe operational stop.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: safe-stop trace ending in payment.blocked]&lt;/p&gt;

&lt;p&gt;Safe success&lt;br&gt;
second_signature.run&lt;br&gt;
└── agent.intent.transfer&lt;br&gt;
    └── policy.evaluate&lt;br&gt;
        └── approval.request&lt;br&gt;
            └── approval.granted&lt;br&gt;
                └── payment.transfer&lt;/p&gt;

&lt;p&gt;The guarded agent waits for approval.&lt;/p&gt;

&lt;p&gt;The approval comes from:&lt;/p&gt;

&lt;p&gt;FINANCE_LEAD&lt;/p&gt;

&lt;p&gt;Only after approval.granted does payment.transfer occur.&lt;/p&gt;

&lt;p&gt;Relevant attributes include:&lt;/p&gt;

&lt;p&gt;agent.variant = guarded&lt;br&gt;
approval.status = approved&lt;br&gt;
approval.approver = FINANCE_LEAD&lt;br&gt;
payment.executed = true&lt;br&gt;
payment.amount = 12500&lt;br&gt;
payment.currency = CAD&lt;br&gt;
governance.outcome = safe_success&lt;/p&gt;

&lt;p&gt;The ledger changes from:&lt;/p&gt;

&lt;p&gt;CAD 50,000&lt;/p&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;p&gt;CAD 37,500&lt;/p&gt;

&lt;p&gt;The payment still succeeds, but this time the governance path is valid.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: safe-success trace showing approval.granted before payment.transfer]&lt;/p&gt;

&lt;p&gt;A custom governance metric&lt;/p&gt;

&lt;p&gt;I also created a custom OpenTelemetry metric:&lt;/p&gt;

&lt;p&gt;agent_governance_outcomes_total&lt;/p&gt;

&lt;p&gt;It separates the three outcomes using labels such as:&lt;/p&gt;

&lt;p&gt;outcome&lt;br&gt;
agent_variant&lt;br&gt;
policy_name&lt;/p&gt;

&lt;p&gt;The resulting series distinguish:&lt;/p&gt;

&lt;p&gt;unsafe_success&lt;br&gt;
safe_stop&lt;br&gt;
safe_success&lt;/p&gt;

&lt;p&gt;and:&lt;/p&gt;

&lt;p&gt;legacy&lt;br&gt;
guarded&lt;/p&gt;

&lt;p&gt;This metric provides a compact operational view of how often agent actions end in each governance state.&lt;/p&gt;

&lt;p&gt;It is useful because a normal success counter would treat both unsafe_success and safe_success as successful executions.&lt;/p&gt;

&lt;p&gt;The governance metric makes the difference explicit.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: agent_governance_outcomes_total in SigNoz]&lt;/p&gt;

&lt;p&gt;Proving the guard invariant&lt;/p&gt;

&lt;p&gt;A dashboard can look convincing while still hiding dangerous edge cases.&lt;/p&gt;

&lt;p&gt;I wanted stronger evidence than a visual claim.&lt;/p&gt;

&lt;p&gt;So I created a trace-matching invariant in SigNoz.&lt;/p&gt;

&lt;p&gt;Query A finds guarded traces where approval was rejected:&lt;/p&gt;

&lt;p&gt;service.name = "second-signature"&lt;br&gt;
AND agent.variant = "guarded"&lt;br&gt;
AND approval.status = "rejected"&lt;/p&gt;

&lt;p&gt;Query B finds traces containing an executed payment:&lt;/p&gt;

&lt;p&gt;service.name = "second-signature"&lt;br&gt;
AND name = "payment.transfer"&lt;br&gt;
AND payment.executed = true&lt;/p&gt;

&lt;p&gt;The trace operator is:&lt;/p&gt;

&lt;p&gt;A &amp;amp;&amp;amp; B&lt;/p&gt;

&lt;p&gt;The result was:&lt;/p&gt;

&lt;p&gt;No results&lt;/p&gt;

&lt;p&gt;This proves that no guarded trace with rejected approval also contained an executed payment.&lt;/p&gt;

&lt;p&gt;The invariant is important because it validates the safety property across the complete trace, not just inside one individual span.&lt;/p&gt;

&lt;p&gt;[Insert screenshot: SigNoz trace-matching query showing no results]&lt;/p&gt;

&lt;p&gt;Detecting unsafe autonomous actions with a critical alert&lt;/p&gt;

&lt;p&gt;I created a trace-based alert named:&lt;/p&gt;

&lt;p&gt;Unsafe autonomous financial action detected&lt;/p&gt;

&lt;p&gt;The alert filter is:&lt;/p&gt;

&lt;p&gt;service.name = "second-signature"&lt;br&gt;
AND name = "policy.audit"&lt;br&gt;
AND governance.outcome = "unsafe_success"&lt;/p&gt;

&lt;p&gt;The aggregation is:&lt;/p&gt;

&lt;p&gt;count()&lt;/p&gt;

&lt;p&gt;The condition is:&lt;/p&gt;

&lt;p&gt;Above 0&lt;/p&gt;

&lt;p&gt;The severity is:&lt;/p&gt;

&lt;p&gt;Critical&lt;/p&gt;

&lt;p&gt;When the unsafe legacy scenario was detected, the alert entered the:&lt;/p&gt;

&lt;p&gt;Firing&lt;/p&gt;

&lt;p&gt;state.&lt;/p&gt;

&lt;p&gt;SigNoz also delivered a real email notification.&lt;/p&gt;

&lt;p&gt;After the alert condition was no longer active, a later notification showed:&lt;/p&gt;

&lt;p&gt;Resolved&lt;/p&gt;

&lt;p&gt;This demonstrated the full lifecycle:&lt;/p&gt;

&lt;p&gt;unsafe action detected&lt;br&gt;
→ alert firing&lt;br&gt;
→ email delivered&lt;br&gt;
→ alert resolved&lt;/p&gt;

&lt;p&gt;Reproducibility with SigNoz Foundry&lt;/p&gt;

&lt;p&gt;The submission repository includes:&lt;/p&gt;

&lt;p&gt;casting.yaml&lt;br&gt;
casting.yaml.lock&lt;/p&gt;

&lt;p&gt;The lockfile was genuinely generated using the official SigNoz Foundry CLI.&lt;/p&gt;

&lt;p&gt;The verified command was:&lt;/p&gt;

&lt;p&gt;foundryctl forge -f casting.yaml&lt;/p&gt;

&lt;p&gt;This also generated the reproducibility output stored under:&lt;/p&gt;

&lt;p&gt;pours/&lt;/p&gt;

&lt;p&gt;For accuracy, I want to be explicit about what was and was not completed.&lt;/p&gt;

&lt;p&gt;Verified:&lt;/p&gt;

&lt;p&gt;foundryctl forge&lt;br&gt;
casting.yaml.lock generation&lt;br&gt;
Foundry deployment files generation&lt;/p&gt;

&lt;p&gt;Not claimed:&lt;/p&gt;

&lt;p&gt;foundryctl cast&lt;br&gt;
complete local SigNoz deployment&lt;br&gt;
local Foundry runtime validation&lt;/p&gt;

&lt;p&gt;The telemetry used in the hackathon evidence was captured in SigNoz Cloud.&lt;/p&gt;

&lt;p&gt;This distinction matters because reproducibility should be documented honestly, not implied.&lt;/p&gt;

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

&lt;p&gt;The most important lesson was that observability for agents cannot stop at technical success.&lt;/p&gt;

&lt;p&gt;An agent can:&lt;/p&gt;

&lt;p&gt;return the correct response&lt;br&gt;
complete the API call&lt;br&gt;
update the ledger&lt;br&gt;
avoid throwing an exception&lt;/p&gt;

&lt;p&gt;and still violate policy.&lt;/p&gt;

&lt;p&gt;That means agent observability needs business and governance context.&lt;/p&gt;

&lt;p&gt;Attributes such as:&lt;/p&gt;

&lt;p&gt;approval.status&lt;br&gt;
guard.enforced&lt;br&gt;
payment.executed&lt;br&gt;
policy.mode&lt;br&gt;
governance.outcome&lt;/p&gt;

&lt;p&gt;can be as important as latency or error rate.&lt;/p&gt;

&lt;p&gt;I also learned several practical OpenTelemetry lessons:&lt;/p&gt;

&lt;p&gt;preserve one root span per scenario&lt;br&gt;
build correct parent-child relationships&lt;br&gt;
instrument short-lived Node.js processes carefully&lt;br&gt;
export metrics before process shutdown&lt;br&gt;
separate application enforcement from observability&lt;br&gt;
use trace-level queries for cross-span safety properties&lt;br&gt;
design alerts around domain failures, not only technical exceptions&lt;/p&gt;

&lt;p&gt;The hardest part was not building the UI.&lt;/p&gt;

&lt;p&gt;It was proving that each outcome was real, queryable, and distinguishable inside SigNoz.&lt;/p&gt;

&lt;p&gt;Final result&lt;/p&gt;

&lt;p&gt;Second Signature demonstrates that one request can produce three very different governance outcomes:&lt;/p&gt;

&lt;p&gt;Missing approval&lt;br&gt;
→ Unsafe success&lt;/p&gt;

&lt;p&gt;Rejected approval&lt;br&gt;
→ Safe stop&lt;/p&gt;

&lt;p&gt;Approved by FINANCE_LEAD&lt;br&gt;
→ Safe success&lt;/p&gt;

&lt;p&gt;The payment alone does not tell the full story.&lt;/p&gt;

&lt;p&gt;The trace does.&lt;/p&gt;

&lt;p&gt;Second Signature turns invisible agent boundary violations into evidence that operators can investigate, audit, and act on.&lt;/p&gt;

&lt;p&gt;Live demo&lt;/p&gt;

&lt;p&gt;&lt;a href="https://second-signature.vercel.app" rel="noopener noreferrer"&gt;https://second-signature.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code and verified evidence&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Faadil1/second-signature" rel="noopener noreferrer"&gt;https://github.com/Faadil1/second-signature&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Video demo&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/5OKJ5xvg0Bc" rel="noopener noreferrer"&gt;https://youtu.be/5OKJ5xvg0Bc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built for Agents of SigNoz&lt;br&gt;
Track 1: AI &amp;amp; Agent Observability&lt;/p&gt;

</description>
      <category>signoz</category>
      <category>opentelementry</category>
      <category>observability</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
