Skip to content

cleanup uc0.1#8

Open
Rahien wants to merge 12 commits into
karel/lbron-1645-add-component-diagram-pipelinesfrom
karel/lbron-1645-cleanup-uc0.1
Open

cleanup uc0.1#8
Rahien wants to merge 12 commits into
karel/lbron-1645-add-component-diagram-pipelinesfrom
karel/lbron-1645-cleanup-uc0.1

Conversation

@Rahien

@Rahien Rahien commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

commits are scoped, have a look at the commit messages for description and/or go commit by commit while reviewing

@Rahien
Rahien requested a review from brechtvdv July 13, 2026 14:05

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file mentions "4. Store the result. The impact direction is stored as an ext:has_impact predicate on the annotation in the AI graph of the triplestore.". However, ext:has_impact does not exists as the impact stored as a second oa:hasBody. Can you update?


- Users with malicious intent could convince the LLM to run destructive queries, inserting or deleting triples into the SPARQL endpoint. This is easily countered by leveraging the [capabilities of mu-authorization](https://github.com/mu-semtech/sparql-parser#define-access-rights-for-specific-services) Simply giving the LLM a scope that only allows read access to the public information in the triplestore is enough.
- Other ill-meaning users could decide to have the LLM run a lot of very heavy queries, resulting in a Denial of Service attack on the system. This can be mitigated by 1) providing the LLM with patterns of such malicious queries and telling it to refuse executing them, 2) extending mu-authorization so it disallows queries matching such patterns, 3) putting limits on the execution time of queries (built in for virtuoso) or queries sent from a certain service (requires an extension of mu-authorization).
- Because the LLM now operates as an agent that can take actions, the risk of prompt injection where malicious content in a retrieved document manipulates the model's behaviour. This becomes more consequential than in the current stateless pipeline, however the plan-execute architecture partially mitigates this by separating planning from execution and by running the monitor as deterministic code rather than as an LLM call, but careful prompt engineering and input sanitisation remain important concerns.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite: the risk of prompt injection...
Suggestion: Since the LLM now operates as an agent that can take actions, it becomes vulnerable to prompt injection—where malicious content embedded in a retrieved document manipulates the model's behavior.


A critical enabler for this architecture is providing the LLM with sufficient knowledge of the data model. Without schema context, the LLM would waste significant effort discovering endpoint structure on every request –which classes exist, which predicates connect them, which prefixes to use or worse, produce syntactically valid but semantically incorrect SPARQL.

The proposed solution is to supply SHACL shape files and example queries as retrieval context before planning begins. SHACL shapes express constraints, properties, prefixes, and class structure in a machine-readable format that the LLM can interpret. Example queries package ready-made patterns, comments, keywords, and endpoint information. Together, they give the planner enough orientation to produce actionable steps and give the executor enough vocabulary to construct correct SPARQL.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to possible future work?
Now using void?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in future work

@Rahien
Rahien requested a review from brechtvdv July 17, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants