Skip to content

Graphne Agent Query Hardening ​

How Graphne keeps the graph queries it writes read-only and bounded, and what you see when a query is refused, cut short or slow.

Requires role: Operator or Admin (to use Graphne) Related: Multi-Agent Intelligence, Security Architecture


Overview ​

When no built-in tool answers your question, Graphne writes a graph query for it and runs it against a read-only view of the database. Every query passes a set of checks before it runs. The checks can't be turned off, and there's nothing to configure.

You notice the checks in three ways:

  • Graphne says a result was cut short, and gives the number of rows returned and the total.
  • Graphne says a query couldn't run, and tries another way.
  • A path search stops at a set depth and time.

What Graphne Checks ​

CheckWhat it doesWhat you see
Read-onlyA query that would change data, or that chains a second statement, is refused. So is a query that reads a collection outside the allowed list, or that picks a collection through a parameter.A reply that the query couldn't run
Document lookupsA lookup of one document must name it with a fixed string or a plain parameter. A document path built from an expression is refused. See Document Lookups.A reply that the query couldn't run
Parameter valuesA value shaped like a document ID must point to an allowed collection.A reply that the query couldn't run
Protected parametersValues the model supplies for the user and target identity are dropped before any query runs. Only the server sets them.Nothing
Identity IDsA tool that takes an identity accepts only a bare key or an identities/<key> ID. Any other collection is refused before the database is read.Nothing, unless the model sends a bad ID
Row limitA query without a row limit gets one of 10,000.At most 10,000 rows
Result sizeA result too large for Graphne's context is cut, with a note of how much was kept. See Truncated Results.Graphne says the result was truncated
Path searchesA path search goes up to 8 hops and returns up to 50 paths. The shortest-path lookup gets up to 60 seconds. See Access Path Searches.A timeout message on a very slow search

Your license also narrows the allowed collections. Graphne can't read data from a feature your license doesn't include.


Document Lookups ​

What this is ​

A document lookup reads one document by its ID. Given a full ID, it can read from any collection. A prompt crafted to steer Graphne could try to build that ID from parts, so the collection name comes from the prompt and not from the query.

Such a query could read collections outside the allowed set, including ones that hold configuration. GraphnAI checks every document lookup in a query before it runs. When the document is named by anything other than a fixed string or a plain parameter, the query is refused.

These forms are allowed:

  • A fixed string, such as identities/abc123.
  • A plain parameter that holds the ID.
  • The two-argument form, with a fixed, allowed collection name and a key.
  • A joined ID whose first part is a fixed, allowed collection name. Its collection can't change.

These forms are refused:

  • An ID built by a function call, such as joining or cutting strings together.
  • The two-argument form with a parameter in place of the collection name.

A parameter that holds a full document ID is checked too. Its collection must be on the allowed list.

What you see ​

Graphne gets the refusal as a tool error. It usually tries the question another way, with a different query or a built-in tool. When it can't, it tells you the query couldn't be completed. You never see a raw database error.

Where refusals are recorded ​

GraphnAI records every refusal in three places:

  • The agent audit log, with the rule the query broke, the first 200 characters of the query, the names of its parameters (never their values), and the user and session that asked.
  • The server's metrics, counted by rule, with a separate count for audit writes that failed.
  • The server log, as a failed tool call whose error includes read-only violation.

Truncated Results ​

What this is ​

A query can return more than fits in Graphne's context. GraphnAI then passes Graphne a subset of the rows, with a note of how much was kept: whether the result was truncated, the rows returned, the total, and the original size in bytes.

Graphne's instructions tell it to mention the cut whenever a result is truncated. It gives the rows returned and the total, keeps its summary to what those rows show, and suggests a narrower question.

What you see ​

Graphne's reply includes a note like this:

"This result was truncated. It shows 50 of 847 rows. For a fuller answer, narrow the question."

This is expected. If it happens often, ask a narrower question, for example scoped to one domain or one identity type. A table that reached the 10,000-row limit also carries a Results truncated badge.


Access Path Searches ​

What this is ​

Graphne's path tool finds the access paths between two identities. It follows up to 8 hops, or 6 unless you ask for more, and returns up to 50 paths. It never walks a sign-in session, and it follows simulated changes only when you ask.

The tool also finds the shortest path, for the highlight in the answer. That lookup gets up to 60 seconds, twice the 30 seconds other queries get, because a path across a large graph can take longer.

What you see ​

  • A path search that finds nothing reports no paths within the hop limit it used.
  • A path search that times out returns an error. Graphne tells you and suggests a narrower search, such as fewer hops or a more specific source and target.
  • A long question can't run forever. Graphne's whole answer, across up to eight tool calls, has 2 minutes on a cloud provider and 12 minutes on a local model.

Troubleshooting ​

Graphne says a query couldn't be completed and tries another approach ​

A check refused the query Graphne wrote, before it reached the database. This happens most with unusual or open-ended questions. Ask the question more simply. If it happens on ordinary questions, search the server log for read-only violation to see which rule refused it.

Graphne says results were truncated, but you need all the data ​

Ask a narrower question. For example, ask "show the top 10 over-permissioned service accounts in domain CORP" instead of "show all over-permissioned identities." For bulk data, use the analysis pages, such as the Identity Inventory, which page through large result sets.

A path search timed out ​

The two identities may be far apart in a large graph. Ask for a shallower search, for example "within 5 hops", or search from an identity you know sits between them. Paths longer than 8 hops aren't searched.

You want to confirm refusals are recorded ​

Check the server's metrics, or search the server log for read-only violation. Each refusal is also written to the agent audit log with its rule.