Basic examples (2)
oGBad = new stzAgentGraph("mailer-bad")
oGBad.AddLLMActor("writer")
oGBad.AddEffect("send")
oGBad.Proposes("writer", "send")
? oGBad.IsSound()
? oGBad.Violations()[1][:message]0 effect 'send' has no guardian edge into it -- every effect passes a pi-gate
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 14-an-agent-that-cannot-hurt.en.md(opens in a new tab)
oGOk = new stzAgentGraph("mailer")
oGOk.AddLLMActor("writer")
oGOk.AddGuardian("gate")
oGOk.AddEffect("send")
oGOk.AddTraceSink("audit")
oGOk.Proposes("writer", "gate")
oGOk.Guards("gate", "send")
oGOk.Feeds("gate", "send")
oGOk.Traces("send", "audit")
? oGOk.IsSound()1
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 14-an-agent-that-cannot-hurt.en.md(opens in a new tab)
Scope (2)
oRep = new stzRuleReport("clean")
oAG = new stzAgentGraph("ok")
oAG.AddLLMActor("writer")
oAG.AddGuardian("gate")
oAG.AddEffect("send")
oAG.AddTraceSink("audit")
oAG.Proposes("writer", "gate")
oAG.Guards("gate", "send")
oAG.Feeds("gate", "send")
oAG.Traces("send", "audit")
oRep.Collect(oAG)
oCG = new stzRingCodeGraph("")
oCG.ScanSource("class Bag" + nl + "def Count()" + nl + " return 1" + nl, "s")
oRep.Collect(oCG)
# no findings
? oRep.NumberOfFindings()
# ...the gate is sound
? oRep.IsSound()0 1
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from rulereport_narrated.ring(opens in a new tab)
oAG = new stzAgentGraph("bad")
oAG.AddLLMActor("writer")
oAG.AddEffect("send")
oAG.Proposes("writer", "send")
aLegacyAgent = StzCheckAgentGraph(oAG.GraphQ()) # [ :invariant, :node, ... ]
aLegacyCode = StzCheckCode("class Bag" + nl + "def Len()" + nl + " return 1" + nl) # [ :line, ... ]
oRep = new stzRuleReport("mixed")
oRep.IngestLegacy(aLegacyAgent, "agentic")
oRep.IngestLegacy(aLegacyCode, "code")
# legacy findings are normalized into the unified shape
? HasKey(oRep.Findings()[1], :rule) and HasKey(oRep.Findings()[1], :subject) and
HasKey(oRep.Findings()[1], :where)
# ...the invariant name became :rule
? len(oRep.Findings()[1][:rule]) > 0
# ...tagged with the given subject
? len(oRep.FindingsOfSubject("agentic")) >= 1
# ...and the code line landed in :where
? len(oRep.FindingsOfSubject("code")) >= 1
# the one gate spans legacy sources too
? oRep.IsSound()1 1 1 1 0
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from rulereport_narrated.ring(opens in a new tab)
The extensions of this method
Each extension, and whether it exists for this method; an extension that exists combines with the others (FindSTCS).
Every example is a test file of the library, run inside the library for this page; only those whose output kept every promise their file wrote are shown.
See also
- The class stzAgentGraph
- The area's reference: Agents & conversation
- The other methods in these examples: stzAgentGraph.AddEffect · stzAgentGraph.AddGuardian · stzAgentGraph.AddLLMActor · stzAgentGraph.AddTraceSink · stzAgentGraph.Feeds · stzAgentGraph.Guards · stzAgentGraph.IsSound · stzAgentGraph.Traces · stzAgentGraph.Violations · stzRingCodeGraph.ScanSource · stzRuleReport.Collect · stzRuleReport.Findings

