Skip to content

research: a semantic capability catalog for chant search, with each lexicon deriving its own facts #4361

Closed

Description

@lex00

Refs #1139 (the derived facts), #1258 (search reports the graph's derived surface), #4359, #4360, INTENTIUS/behold#906.

Question

Should chant own a catalog of semantic capabilities, with each lexicon supplying the rules that derive them? An agent could then turn a person's question ("what in prod can be reached on SSH from the internet?") into chant search terms without guessing attribute names. If so, what should a capability be, and who writes the rules?

This is research. Write the comparison and a recommendation for the maintainer. Nothing is built here.

Why ask

Two derived facts are what turn a multi-hop question into one search term, and they are part of why chant's arm does well on aws-bench (ec2-multiregion):

  • effectiveIngress: the security-group rules that reach an instance, including through its launch template.
  • internetFacing: the instance's subnet routes to an internet gateway.

Both are in packages/core/src/graph-effective.ts (#1139). They are hand-coded in core, cover EC2 only, and select nodes by CloudFormation kind (isKind(n, "SecurityGroup") matches ...::SecurityGroup). So:

  • A stock Terraform root gets neither. The terraform lexicon's kinds are aws_instance and aws_security_group, so the folds never run on them.
  • Every new fact is a change to core, not to the lexicon that knows the substrate.
  • An agent finds a fact only after it exists. --explain and derivedSurface (chant search should report the graph's derived surface #1258) say which derived attributes a graph carries. Nothing says what a fact means, which questions it answers, or which lexicons supply it. So the agent cannot map a person's words onto it ahead of time.

The idea

A catalog. Each capability has:

  • a stable name and a one-line meaning ("internet-reachable: a path exists from the internet to this resource");
  • parameters, where it has any (a port, a protocol);
  • the search term or terms it adds;
  • for each lexicon, a rule that derives it from that lexicon's graph, or a statement that the lexicon cannot.

Candidates beyond the two that exist:

  • stores data;
  • encrypted at rest;
  • publicly readable;
  • grants access to (an identity's reach);
  • crosses a network boundary;
  • runs code;
  • holds a secret.

The catalog is published where agents look: the MCP search tool's description, chant search --capabilities, and the agent docs. An agent then reads it once, instead of rediscovering attribute names on every question.

What to find out

  1. The shape. Is a capability a derived attribute, as today, or a named query that expands to terms? What does each choice do to --explain's universe counts and near-misses?
  2. Ownership. Rules in each lexicon, behind a core interface, against keeping them in core. The terraform lexicon needs the AWS rules on aws_* kinds. Can one rule serve CloudFormation and Terraform kinds of the same resource, or does each lexicon carry its own?
  3. Live, declared and snapshot. Today's folds run on all three (Separate observation from folding, so a fold can run over a snapshot #1271, Deep snapshots: record the property trees the folds need, not just identity #1267). Which capabilities need live data to be true, and how does a capability say it was computed from declared data only?
  4. The vocabulary. Which capabilities the first version ships. Start from questions people ask: aws-bench's eight, behold#906's seven, and the security questions an agent gets most often.
  5. The evidence. Run aws-bench with the catalog in the agent's context and without it. Compare pass rate, tokens and tool calls against the current chant arm. The catalog has to pay for its own tokens.

Who uses it

behold draws a query an agent ran (INTENTIUS/behold#907). The catalog is what makes the agent's query right in the first place. Agents using chant search without behold benefit the same way.

Acceptance criteria (research)

Part of INTENTIUS/behold#908 (step 6 waits on this ruling). #4362 makes today's two facts work on Terraform kinds in the meantime.

  • A comment on this issue holds the measurement from the rule-language comment above: the three capabilities (what an identity can reach, exfiltration paths, blast radius), each written in every candidate language, against one AWS estate in its CloudFormation and its Terraform form. The table covers expressibility, lines of rule, correctness against hand-checked answers, evaluation time, and what --explain can print.
  • The comment ends with a recommended rule language and a first vocabulary.
  • Implementation issues for the recommendation are filed and linked once the maintainer has ruled, not before.
  • No production code merges under this issue.

Activity

  1. lex00 commented on Oct 23, 2026

    @lex00
    ContributorAuthor

    The rule language is the main question

    The graph query only reaches people through this layer. Nobody types a path query. They ask "what can reach the customer database?", and the capability turns that into one. So the further the catalog goes past simple facts, the more its rules need a real graph query language, and the language a rule is written in is the first decision here, before the vocabulary.

    Why simple rules won't last

    graph-effective.ts is a TypeScript traversal: instance, subnet, association, route table, route, gateway. Each new capability is new code in core, and the same rule has to be written again for Terraform kinds that differ only in their labels.

    The questions people care about combine capabilities and follow paths of any length:

    1. What an identity can reach. Policy, role, principal, resource, followed across trust relationships to any depth, filtered by actions and conditions.
    2. Exfiltration paths. Compute that is internet-reachable and assumes a role that grants access to a data store that holds a secret. Three capabilities, joined along one path.
    3. Blast radius of a compromise. Everything reachable from a given resource through the network or through identity, with the path to each.

    The search grammar cannot express these, even with transitive edges (#4359). They need pattern matching over paths, with capabilities referring to other capabilities.

    Rules as declared patterns

    If each capability's rule is a declared graph pattern rather than code:

    Three candidate languages

    Rule language Covers Costs
    TypeScript functions (today) Anything Code per capability and per lexicon. Cannot be shipped as data. No path comes out unless each rule writes one
    A small path-pattern language over chant's IR, extending #4359 Paths of any depth, attribute filters, capabilities referring to capabilities, the path in the answer A matcher to build and keep correct
    A subset of Cypher, run on LadybugDB (@ladybugdb/core) Full pattern matching, ready-made, with variable-length paths A native dependency, and the IR loaded into the engine on each run. Cannot be the default engine under "just works" (INTENTIUS/behold#906)

    Here LadybugDB would be the engine that evaluates rules, not a surface people query. Engine and dialect are separate choices. A Cypher-subset rule could also be evaluated by an in-house matcher, which would keep the rules portable even if the engine changes.

    The measurement that decides

    Write the three capabilities above (what an identity can reach, exfiltration paths, blast radius) in each candidate language, against one AWS estate in both its CloudFormation and its Terraform form. For each language, compare:

    • whether it can express all three at all;
    • the lines of rule per capability, and per extra lexicon;
    • correctness against hand-checked answers;
    • evaluation time on the terralith at scale 4 and on aws-bench's estate;
    • what --explain can print for a match.

    The cheapest language that expresses all three wins. If none of the cheaper ones can, that is the case for Cypher on an optional engine, with the simpler capabilities still evaluated without it.

  2. added
    area:core
    design
    demo:ask-your-agent
    on Oct 23, 2026
  3. lex00 commented on Oct 23, 2026

    @lex00
    ContributorAuthor

    Measurement: the rule language

    This is the measurement asked for in "The rule language is the main question": the three capabilities written in each of the three candidate languages, run against one AWS estate in its CloudFormation form and its Terraform form, and scored against answers checked by hand. It ends with a recommendation and a first vocabulary. The ruling is the maintainer's. Nothing here is filed for implementation, and no production code merged.

    All of it is prototype code in an unpushed chant worktree (chant-worktrees/research-4361/scratch-4361/, branched from main at 201931e). LadybugDB @ladybugdb/core 0.21.2 was installed only in a scratch directory.

    The estate

    The terralith at scale 4 and aws-bench's estate have no path that all three capabilities can exercise. The terralith's policies grant on * and on bucket ARNs the estate doesn't declare, and aws-bench's one role holds a Deny and an AWS-managed ARN. So I wrote a small estate, "ledger", twice: as a chant aws project (CloudFormation) and as a stock .tf root. Each form names the same 38 resources. It is built so that a rule that cuts corners gets a wrong answer:

    • a VPC with a public subnet (routed to an internet gateway) and a private one;
    • three security groups whose ingress is written three ways: inline CIDR, inline source group, and a standalone rule resource (AWS::EC2::SecurityGroupIngress / aws_vpc_security_group_ingress_rule);
    • webServer, which gets its open group (22 and 443 from 0.0.0.0/0) only through its launch template. adminBox sits in the public subnet but admits nothing from the internet, and worker is private;
    • two Lambdas. reporter has a function URL with AuthType NONE, and batch has none;
    • six roles, with inline, standalone and managed policies, TF policy attachments, and a bucket policy that names a role as principal. One assume-role chain goes by reference with a matching trust policy (webRole -> deployRole). One goes by ARN string (batchRole -> arn:...:role/audit);
    • data: two buckets, one tagged data-classification=restricted (in TF through a local), a DynamoDB table, a secret, and an RDS instance in a group that admits the app group.

    Answers by hand: identity reach is 13 (role, resource) pairs. Exfiltration is 3 (compute, store) pairs: webServer -> customerData and webServer -> dbSecret, both through deployRole, plus reporter -> customerData. Blast radius is 15 members from three starts: 10 from webServer, 2 from reporter, 3 from batch.

    What all three languages read

    chant's IR cannot serve as a rule surface for these questions as it stands, in any of the three languages:

    • IAM statements and inline SG rules are nested property trees. An edge says only that webPolicy references deployRole through PolicyDocument. It doesn't say which statement does it, with which actions, or as resource or as principal.
    • In the TF IR, a policy is HCL text inside a string ("${jsonencode({...})}").
    • TF has link resources (aws_iam_role_policy_attachment) where CloudFormation has a direct reference.
    • CloudFormation kinds are AWS::EC2::Instance, while TF kinds are all Terraform::Resource, with the type in the address.

    So every language reads the same lexicon-neutral view, built by a per-lexicon mapping and adapter (view.ts, 168 lines):

    • Mapping, as data (28 lines for aws, 27 for terraform): kind to label (Instance, Role, SecurityGroup, ...), viaAttr to edge name (SubnetId / subnet_id -> subnet), and a few attributes.
    • Adapter, as code: it explodes each policy statement and inline ingress rule into a node, with statement, resource, principal, ingress and source edges. It turns link resources into edges and resolves an ARN that names a declared role. TF policies are read with the lexicon's own readJsonencode(..., { unknownLeaves: true }).

    That cost is the same whichever language wins, and it is where the per-lexicon work lives. With the mapping in place, the rules themselves needed 0 changed lines for Terraform, in every language.

    The table

    A: TypeScript over the IR B: path patterns (extends #4359) C: Cypher on LadybugDB
    Expresses all three yes yes yes
    What the language had to have nothing transitive steps over named edges, including derived ones (->can-assume*); optional hops (->template?); a back-reference that closes a cycle (the trust check ends at a); node-set conditions ([@holds-secret]); label and edge alternation; =, in and IAM-glob ~ attribute tests derived edges MERGEd in stages; EXISTS for node-set conditions; * SHORTEST for closures (its lower bound must be 1, so a 0-hop case is a second statement)
    Lines: identity reach 21 4 14
    Lines: exfiltration, beyond reach 25 9 19
    Lines: blast radius, beyond the two 16 3 12
    Lines: shared helpers 11 0 0
    Total lines / characters 74 / 5.2k 16 / 1.3k 45 / 4.4k
    Lines per extra lexicon (rules) 0 over the view (74 again without one, which is the #4362 route) 0 0
    Lines per extra lexicon (mapping + adapter) ~27 data + ~20 code, shared by all three same same
    Ships as data no yes yes
    Engine to build and keep none parser + matcher, 132 lines in the prototype 52-line loader, plus a 20 MB native addon
    Correct, CloudFormation form (reach / exfil / blast) 13/13, 3/3, 15/15 13/13, 3/3, 15/15 13/13, 3/3, 15/15
    Correct, Terraform form 13/13, 3/3, 15/15 13/13, 3/3, 15/15 13/13, 3/3, 15/15
    Correct, CloudFormation IR as it is on main 10/13, 2/3, 13/15 same misses same misses
    Mutation: delete the deployRole trust edge drops exactly the 2 + 2 + 1 it should same same
    Correct at 10 / 100 / 1000 disjoint copies (exfil) 30/30, 300/300, 3000/3000 same 12/30, 102/300, 1002/3000
    Time, ledger CFN / TF (median of 5) 0.2 / 0.2 ms 0.3 / 0.3 ms 143 / 145 ms
    Time, aws-bench estate CFN / TF 0.1 / 0.1 ms 0.3 / 0.2 ms 159 / 145 ms
    Time, terralith scale 4 (256 view nodes) 0.3 ms 1.3 ms 149 ms
    Time, 5.8k / 58k view nodes 15 ms / 176 ms 35 ms / 394 ms 362 ms / 2.3 s (load 0.35 s by COPY FROM; 325 s by UNWIND)
    What --explain can print whatever each rule builds. About a third of A's lines are path bookkeeping every hop with its edge name, automatically, with derived edges expanded into the hops that proved them nodes(p) of one MATCH. Across derived capabilities the author carries evidence by hand (list_concat), and my C evidence lost the ingress-rule hop in network

    Times are from Node 24.13 on an M-series Mac. The 58k figure uses 1000 disjoint copies of the TF ledger view, because no real estate here is large enough to show growth. The view itself takes 0.4 to 2.7 ms on every real estate and is left out of the table. On the aws-bench estate, internet-reachable returns launchTemplateServer and webServer in both forms, one of them only through its launch template, which is aws-bench's SSH answer. The terralith returns no reach, for the reason given above, but the rules walk all of it.

    Three notes on correctness:

    • The IR bounds correctness: on the CloudFormation form as main builds it, all three languages miss the same answers. A Sub reference (Sub`${assets.Arn}/*` , {{resolve:secretsmanager:${Ref(secret)}}}) becomes {"$intrinsic": true} with no edge. The rows above that score full marks use a ~10-line local patch to graph-ir.ts (never pushed). I filed that gap as graph IR: a reference inside a CloudFormation Sub becomes an edge, not an opaque intrinsic #4373. The TF form needed nothing, because hcl2json resolves "${aws_s3_bucket.assets.arn}/*".
    • LadybugDB 0.21.2 returns wrong rows. A 6-hop, mixed-direction MATCH with a property filter on each rel finds 1 row on 5, 10 or 100 disjoint copies of a 6-node chain, where it should find 5, 10 or 100. With 4 hops it finds 2. The repro is below. In the prototype, the same multi-part pattern gave 0 or 1 rows depending on the order of its parts. A MERGE of a self-loop silently creates nothing. Its variable-length steps don't enforce distinct relationships (a 2-hop ->()<- pattern counts the same edge twice), and $starts is refused as a parameter name. C matches the hand answers on the one-copy estate only because I rewrote its rules around each of these.
    • None of the three handles explicit Deny, IAM Condition, Resource: "*" or data.aws_iam_policy_document. The estate has none of the first three on a path that matters, so the rules leave them out. Adding Deny needs negation in B (see below).
    LadybugDB repro (scratch dir, node repro3.mjs 10)
    import lbug from "@ladybugdb/core";
    const N = Number(process.argv[2] ?? 10);
    const db = new lbug.Database(":memory:"); const c = new lbug.Connection(db);
    const q = async (s, p) => (await (p ? c.execute(await c.prepare(s), p) : c.query(s))).getAll();
    await q("CREATE NODE TABLE R(id STRING, label STRING, PRIMARY KEY(id))");
    await q("CREATE REL TABLE E(FROM R TO R, name STRING)");
    const nodes = [], edges = [];
    for (let k = 0; k < N; k++) {
      for (const [id, label] of [["i","Instance"],["s","Subnet"],["a","Assoc"],["t","Table"],["r","Route"],["g","Igw"]]) nodes.push({ id: `${k}${id}`, label });
      for (const [f, t, n] of [["i","s","subnet"],["a","s","subnet"],["a","t","table"],["r","t","table"],["r","g","gateway"]]) edges.push({ f: `${k}${f}`, t: `${k}${t}`, n });
    }
    await q("UNWIND $rows AS n CREATE (:R {id: n.id, label: n.label})", { rows: nodes });
    await q("UNWIND $edges AS e MATCH (a:R {id: e.f}), (b:R {id: e.t}) CREATE (a)-[:E {name: e.n}]->(b)", { edges });
    console.log(await q(`MATCH (c:R {label: 'Instance'})-[:E {name: 'subnet'}]->(:R {label: 'Subnet'})<-[:E {name: 'subnet'}]-(:R {label: 'Assoc'})
      -[:E {name: 'table'}]->(:R {label: 'Table'})<-[:E {name: 'table'}]-(r:R {label: 'Route'})-[:E {name: 'gateway'}]->(g:R {label: 'Igw'}) RETURN count(*) AS rows`));
    // N=1 -> 1, N=2 -> 2, N=5 -> 1, N=10 -> 1, N=100 -> 1

    The rules in B, the language I recommend

    These 16 lines are all of B. The same file ran unchanged against both forms. A capability with one variable is a node set, used as [@name]. A capability with two is a named edge, followed as ->name, and it carries the hops that proved it.

    in-sg(x, g)              := x ->template? ->sg g:SecurityGroup
    internet-facing(c)       := c:Instance ->subnet :Subnet <-subnet :RouteTableAssociation ->table :RouteTable <-table :Route[dest in ("0.0.0.0/0", null)] ->gateway :InternetGateway
    open-to-world(c)         := c:Instance ->in-sg ->ingress :IngressRule[cidr = "0.0.0.0/0"]
    internet-reachable(c)    := c[@internet-facing, @open-to-world]
                              | c:Function <-function :FunctionUrl[authType = "NONE"]
    runs-as(c, r)            := c ->(profile|task)? ->role r:Role
    grants(r, x)             := r:Role <-attachedTo? ->statement :Statement[doc = "permission", effect = "Allow"] ->resource x
                              | r:Role <-principal :Statement[doc = "resource", effect = "Allow"] ->resource x
    can-assume(a, b)         := a:Role <-attachedTo? ->statement :Statement[doc = "permission", effect = "Allow", actions ~ "sts:AssumeRole"] ->resource b:Role ->statement :Statement[doc = "trust", actions ~ "sts:AssumeRole"] ->principal a
    reaches(r, x)            := r:Role ->can-assume* ->grants x
    holds-secret(x)          := x:Secret
                              | x:Bucket|Table|Database[classification in ("restricted", "secret")]
    exfiltrates(c, x)        := c[@internet-reachable] ->runs-as ->reaches x[@holds-secret]
    network(a, y)            := a ->in-sg <-source :IngressRule <-ingress :SecurityGroup <-in-sg y:Instance|Database|Function
    pivot(a, b)              := a ->(runs-as|can-assume|network) b
    blast(s, x)              := s ->pivot* ->grants? x
    

    Here is what --explain printed for one exfiltration match from B, on the Terraform form. The CloudFormation form reads the same with logical ids.

    exfiltrates aws_instance.web -> aws_s3_bucket.customer_data
      internet-reachable: aws_instance.web -subnet-> aws_subnet.public <-subnet- aws_route_table_association.public -table-> aws_route_table.public <-table- aws_route.public_default -gateway-> aws_internet_gateway.igw
                        & aws_instance.web -template-> aws_launch_template.web -sg-> aws_security_group.web -ingress-> aws_security_group.web#ingress[0]
      path: aws_instance.web -profile-> aws_iam_instance_profile.web -role-> aws_iam_role.web <-attachedTo- aws_iam_role_policy.web -statement-> aws_iam_role_policy.web#stmt1
            -resource-> aws_iam_role.deploy -statement-> aws_iam_role.deploy#stmt0 -principal-> aws_iam_role.web <-attachedTo- aws_iam_policy.deploy -statement-> aws_iam_policy.deploy#stmt0 -resource-> aws_s3_bucket.customer_data
    

    An agent can quote that path, and behold can draw it (behold#907). It includes the trust statement that makes the assume-role hop real.

    The prototype spells a step ->name?. In #4359's landed grammar (arrow, depth, qualifier, target), the same step would be ->{0,1}[e=template] and ->*[e=can-assume]. That way rules and chant search share one path syntax, and a capability becomes a search term: cap:internet-reachable for a node set, or ->[cap=reaches] for an edge.

    The same capabilities in C (Cypher, 45 lines) and A (TypeScript, 74 lines)

    C is c-rules.cypher in the prototype directory. One node table R(id, label, ...) and one rel table E(name, ev). Each binary capability is MERGE (a)-[e:E {name: 'grants'}]->(b) ON CREATE SET e.ev = properties(nodes(p), 'id'). Each node set is a witness edge E {name: '@holds-secret'}, and conditions on it are EXISTS { MATCH (c)-[:E {name: '@internet-reachable'}]->(:R) }. Blast is a * SHORTEST 1..30 over pivot edges, UNION ALL the grants of each role reached.

    A is a-ts.ts: helper closures over an edge index (out, inc, is), the same functions as the B rules, and BFS for reaches and blast, with each path built by hand. Today's graph-effective.ts scans ir.edges linearly on every lookup. The prototype did the same at first and took 136 s at 58k nodes, then 176 ms once it had an index.

    Recommendation

    Rule language: B, a small path-pattern language that extends #4359's search grammar. Core evaluates it with its own matcher over the IR. Each lexicon ships its rules and its label mapping as data.

    B is the cheapest of the three that expresses all three capabilities. It took 16 lines against Cypher's 45 and TypeScript's 74. One file served both lexicons. --explain gets every hop with no work from the rule author, and the run time is well under a millisecond on every real estate.

    Its cost is a matcher to build and keep correct. In the prototype that was 132 lines. A production version with error messages, the additions below and tests is plausibly a few hundred lines. The prototype's matcher is naive: it tries every node as a start for every rule. That still gave 394 ms at 58k nodes, and an index by label would cut it.

    Cypher on LadybugDB should not evaluate rules. On this measurement it returned wrong answers to a plain multi-hop MATCH, which is disqualifying for security questions until upstream fixes it. It also adds a 20 MB native dependency and a ~140 ms floor on every run, so it can't be the default under behold#906's "just works". The B rules could be translated to Cypher mechanically if an optional export (behold#906) ever wants them, so choosing B leaves that door open.

    TypeScript stays as the language of each lexicon's adapter (statements as nodes, link resources as edges, ARN-by-name resolution). It stops being the language of capabilities.

    What B needs before it ships, all found by this measurement:

    Where the catalog is published

    The issue body proposed the MCP search tool's description. That tool searches the resource-type catalog, not the estate, so it's the wrong place (behold#908, "Design check: chant workspace and the read contract", finding 5). I recommend publishing the catalog through chant's read contract (ws-017, reference/workspace-read-contract.mdx), like every other document behold, hud and agents read:

    • A contract document, capabilities. It carries contract, $schema and chant, with failures as error: { code, message }. Its schema goes under src/workspace/ (for example capabilities.schema.json), and it is listed in the contract table and the conformance suite. One entry per capability gives:

      • name and a one-line meaning;
      • shape, either set or edge;
      • params;
      • search, the term it adds (cap:internet-reachable);
      • answers, the questions it serves in people's words;
      • depth: declared, live or either;
      • lexicons, a map from lexicon to supported or a reason code such as capability-not-derivable;
      • rule, the rule text.

      chant search --capabilities --json prints it.

    • Served by a chant MCP tool (for example capabilities) that wraps the same document, as workspace-graph and workspace-ls already do. behold passes the document through unchanged. An agent reads it once per session. The token cost of putting it in context is what the aws-bench run below measures.

    How rules evaluate across a declared workspace

    chant workspace graph reads each member under its own toolchain and composes the results with <member>/<id> ids. Edges between members exist only through declared links. I recommend splitting the work at the view:

    1. Per member, under the member's toolchain: the lexicon's mapping and adapter. These are lexicon code at the member's pinned version, the same as its chant graph. Their output (labels, statement and rule sub-nodes, derived edges) travels in the member's graph document at a detail tier, and is cached by the member's stamp like any other member read.
    2. Once, over the composed graph, by the workspace's chant: the B matcher, which is lexicon-neutral. Rules that stay inside one member give the same answers they would per member. Rules that cross members (a role in platform granted a bucket in data, an ARN that names a role in another member) can only cross over edges in the composed graph. So the composer needs a resolution pass for ARN and name references across members, emitted as edges with member on each end. Today those pairs are joined only through declared links.

    Evaluating rules per member and taking the union would miss exactly the cross-member exfiltration and blast paths the questions are about. It would also put the join in the reader, which ws-052 rules out. The capability results then belong in the workspace form of search (behold#908's proposal B, chant workspace search), with each match carrying <member>/<id> and its path.

    First vocabulary

    This starts from aws-bench's eight questions, behold#906's seven, and the security questions people ask most. B expressed every rule below that this measurement wrote. The rest need the negation and parameters listed above.

    Capability Shape Meaning Answers Depth
    internet-facing set its subnet routes 0.0.0.0/0 to an internet gateway aws-bench "instances in a public subnet" (4 declared, 5 with live; the default VPC is live-only) either
    open-ingress(port?, proto?) set a security group reaching it, directly or through a launch template, admits 0.0.0.0/0 or ::/0 today's effectiveIngress term declared
    internet-reachable(port?) set internet-facing and open-ingress, or a function URL with no auth. Load balancers and API gateways come later aws-bench "SSH from the internet" (2, one only through its launch template, correct in both forms here); "what in prod can be reached on SSH from the internet" either
    attached-to-nothing set no member, attachment or route references it (needs negation) aws-bench "unused security groups" (4); the negative questions on subnets with no network interfaces and VPCs with no running instances either
    in-default-vpc set in the account's default VPC aws-bench "instances without default VPC" live
    stores-data set bucket, table, database, queue, file system or secret "where is our data" declared
    holds-secret set a secret, an SSM SecureString, or a data store tagged as restricted (tag key configurable) step 3 of exfiltration declared
    encrypted-at-rest set per-kind attribute test compliance questions declared
    publicly-readable set a bucket or resource policy with principal * and no public-access block "what is public" declared
    runs-as edge compute -> role (instance profile, Lambda role, ECS task role) step 2 of exfiltration; "what identity does X run as" declared
    can-assume edge role -> role, where both the caller's permission and the target's trust allow it identity chains declared
    grants(action?) and reaches(action?) edge role -> resource by identity or resource policy; reaches is can-assume* then grants capability 1, "what can reach the customer database" (read in reverse) declared
    network edge host -> host through security-group-to-group ingress part of blast radius declared
    exfiltrates edge internet-reachable -> runs-as -> reaches -> holds-secret capability 2 declared
    blast edge pivot* (runs-as, can-assume, network), then what each identity reached is granted capability 3 declared

    behold#906's question 5 (find resources by attribute) is what the catalog serves. Questions 1 to 4 and 6 are search features (#4359, #4358, #4360) rather than capabilities. Question 7 (choudoufu ownership) could be a later owned-by set over the live-plan -json read.

    Deferred to the end-of-run test pass

    Item 5 of the issue, the aws-bench run with the catalog in the agent's context and without it, was not run, by the run's rule. The run I propose:

    • Two arms on ec2-multiregion plus its negatives, k=3. One is today's chant arm (chant-ec2-multiregion-search-v2, briefing-chant-snapshot.md). The other is chant-catalog: the same source, with a briefing that appends the capabilities document as chant search --capabilities prints it. Until that exists, a hand-written block of the vocabulary above stands in.
    • From chant-bench: MATRIX_NEGATIVES=1 just matrix 3 ../aws-bench chant chant-catalog.
    • Compare pass rate, input tokens and tool calls per question.
    • The catalog pays for its tokens only if the catalog arm's total input tokens are not higher, at an equal or better pass rate. The questions it should move are the SSH question and the unused-groups question.

    Filed while doing this: #4373, a feature to resolve references inside a CloudFormation Sub into edges.

  4. lex00 commented on Oct 23, 2026

    @lex00
    ContributorAuthor

    Maintainer ruling (2026-10-23)

    • Rule language: path patterns extending search: follow edges transitively and by attribute, and print the path #4359's search grammar. Lexicons ship rules and kind-to-label mappings as data, and core evaluates them with its own matcher. LadybugDB doesn't evaluate rules.
    • First vocabulary: all 15 capabilities in the measurement's table.
    • Publication: a capabilities read-contract document served by chant's MCP (behold#908's read-contract ruling).

    Implementation: #4375. Part of INTENTIUS/behold#908.

  5. lex00 commented on Oct 23, 2026

    @lex00
    ContributorAuthor

    Research done and ruled. Implementation is #4375.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coredemo:ask-your-agentdesign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions