r/LLMDevs • • 2d ago

Resource I built an open-source security runtime that controls what AI agents can actually do

Over the past few weeks, I've been building Charavyuha at Quaspar, a Python security runtime that enforces permissions outside the model itself.

It currently supports:

  • Cryptographically signed agent requests
  • Tool-level authorization
  • Mission contracts that restrict agents to specific workflows
  • Credential brokering
  • Confidential data tracking
  • Human approval for sensitive actions
  • Replay protection and authenticated crash recovery

Routine authorized operations don't require human approval.

After several rounds of AI-assisted development and independent AI-assisted security testing, I finally released the public beta. In the final local acceptance tests, it passed 120 crash-recovery trials and 120 concurrent initialization trials without unrecoverable journals or stale-state errors.

It's free, Apache 2.0 licensed, and doesn't require a account.

Try it:

pip install quaspar-shield-core==0.11.0b1

https://pypi.org/project/quaspar-shield-core/0.11.0b1/

It's still a single-host beta, and protected process isolation currently requires Linux.

I'm curious how other developers are handling agent security. Are you relying primarily on prompt guardrails, sandboxing, or explicit authorization at the tool level?

I'd appreciate technical feedback, especially from anyone building agents that interact with sensitive systems.

Company : Quaspar.com/technologies

2 Upvotes

7 comments sorted by

1

u/mickmateau 1d ago

Interesting project. I've been working through some similar security and robustness problems in a couple of AI research projects, and I think enforcing authority outside the model is definitely the right direction.

The discussion about crash recovery and idempotency is particularly important. One thing I'd be interested in exploring further is the distinction between recovering execution state, recovering authority, and recovering the actual consequences of execution. They aren't necessarily equivalent.

For example, when an agent resumes after an interruption, how do you establish that its original mission authority is still valid? Permissions may have been revoked, resources modified by another agent, or an external operation may have succeeded without its acknowledgement being recorded.

A few other areas I'd be interested in:

  • Non-resettable execution budgets that survive crashes, retries and delegation, so restarting a worker doesn't inadvertently grant it fresh authority or resources.
  • Dependency-aware recovery, where an uncertain operation blocks its dependent tasks without necessarily invalidating independently completed portions of a workflow.
  • Separating authority revocation from actual worker termination, external-effect reconciliation and resource retirement.
  • Independent freshness evidence for authenticated journals, particularly where the journal and its local witness could both be restored to an earlier valid state.
  • Consequence verification rather than relying solely on successful tool return codes.

I also think the coverage of fault-injection testing is potentially more informative than the number of recovery trials. Have you considered modelling the execution and recovery lifecycle as an explicit state-transition system, then testing interruptions at each transition boundary, including interruptions during recovery itself?

Something I've found interesting is that the information needed to reconstruct an execution history isn't necessarily the same information needed to safely continue execution. The latter may require retaining unresolved dependencies, current authority, resource ownership and evidence of externally committed effects.

The challenge, I think, is achieving all of this without introducing so many approval layers that the agent loses its practical autonomy. Bounded authority with deterministic enforcement seems a much better direction than requiring human confirmation at every step.

I'd be interested to hear how you're approaching these distinctions, particularly as you move beyond single-host execution.

1

u/Automatic_Method4081 1d ago

Really appreciate this level of feedback. I agree that recovering execution state, recovering authority, and verifying consequences are three separate problems.

We're approaching them separately in Charavyuha:

  • Authority: Resuming an execution doesn't automatically restore its permissions. We revalidate identity, revocation, policy, mission scope, and remaining budgets before execution.
  • Budgets: Mission budgets persist across restarts, and delegated agents draw from a shared root budget. Our upcoming release also preserves spent budgets when an operator amends a mission.
  • Dependencies: Durable approvals allow uncertain actions to remain unresolved while independent tasks continue. The application still owns the broader workflow and its checkpoints.
  • Consequences: We persist idempotency keys before external calls and support provider-status reconciliation. Neither a successful tool return nor a recovered journal necessarily proves an external effect occurred.

Revoking authority also doesn't necessarily terminate an already-running worker or reverse its actions. Those need separate containment and reconciliation mechanisms.

Regarding fault injection, we've been testing explicit execution transitions, including interruptions before reservation, after external effects, during journal publication, and during recovery itself. Our latest independent acceptance included 100 randomized process terminations alongside deterministic crash-boundary tests.

Independent freshness is still an important limitation. Joint restoration of local state and its witness is currently undetectable and can allow a completed approval to execute again under a refreshed authorization. Addressing this, alongside distributed budget enforcement and hardware-backed trust, is part of our longer-term roadmap.

Ultimately, I share your philosophy. Humans should define the boundaries of an agent's authority, not become responsible for approving every decision within those boundaries. The goal is meaningful autonomy with deterministic enforcement.

I'd genuinely be interested in hearing more about how you've approached these problems in your research. If you have any other valuable feedback please send it our way. If this is a company you are interested in working on you can reach out anytime. Quaspar.com

1

u/mickmateau 1d ago

Thanks for such a detailed response. It's refreshing to see someone taking these distinctions seriously, particularly your acknowledgement of the limitations around independent freshness and joint rollback.

The shared root budget and preservation of consumed budgets across mission amendments are particularly interesting. I imagine distributed enforcement introduces some additional challenges around reserved, consumed, released and uncertain expenditure, especially when a delegated worker disappears after potentially committing an external effect.

I'd also be interested in exploring the distinction between authority lineage and computational dependency. An agent may depend on another agent's result without inheriting its authority, while revoking a parent's authority shouldn't necessarily invalidate every independently verified result produced by its descendants. Maintaining these as separate but related structures could offer some useful recovery and coordination properties.

Regarding my own research, I'm currently working on two related private projects, one predominantly mathematical and the other experimental, alongside an application intended to bring their mechanisms together.

A substantial part of the mathematical work concerns structural dependencies, observer-dependent information retention, computational equivalence and the information required to preserve future computational behaviour.

Within a defined mathematical domain, we've established that computations can have equivalent terminal structural states while possessing different historical and numerical trajectories. We've also been investigating how much structural information must be retained depending on what an observer is required to distinguish.

One direction I'm particularly interested in is whether these principles can eventually contribute to autonomous workflow recovery. Rather than reconstructing or replaying an entire execution history, could a system retain a sufficient representation of active dependencies, unresolved obligations and verified outcomes to safely continue? Naturally, extending the mathematical results into general agent systems requires considerably more investigation.

We're currently developing the experimental infrastructure to record, visualise and compare genuine computational trajectories, including recurrent model execution. The longer-term objective is to investigate whether structural information can assist computational scheduling, verification and coordination across heterogeneous agents.

Your comment that the application owns the broader workflow and checkpoints caught my attention, as that appears to be an area where our respective research directions could potentially complement each other.

I'd certainly be interested in keeping in touch and exchanging ideas as both projects develop. I appreciate the invitation.

2

u/ianreboot 2d ago

Prompt guardrails are the only one of the three a model can talk its way past, and tool-level authorization is where I'd put the weight. Your crash-recovery number only means as much as where the kill lands though: the window that decides replay protection sits between the tool call succeeding and the journal recording it, so the test worth running injects the kill in that gap, restarts, then checks the operation wasn't replayed or silently dropped. If the side effect and the journal write can't be ordered atomically, write the intent before the call and treat an intent with no completion record as unknown rather than done.

1

u/Automatic_Method4081 1d ago

Thank you for the comment! That's exactly why we record the intent before executing the tool. If it crashes before recording the result, we mark the action as uncertain rather than automatically retrying it. We tested this across multiple crashes and recoveries, and the side effect only occurred once. I'd definitely like to expand testing around that specific failure window, especially with external APIs.

1

u/ianreboot 1d ago

The external API case is where local state can't answer the question any more, since nothing you do on restart can roll back a charge the provider already accepted. So the intent record has to hold an idempotency key you generate and send with the call, and the retry replays that exact key so it lands as the same request instead of a second one. Where a provider has no such key, the thing worth asserting is that recovery parks it as unknown and asks, not that it retries. Early pruning of those intent rows turns a restart into a replay.

1

u/Automatic_Method4081 1d ago

Agreed, we've actually implemented this in our upcoming 0.12.0b1 release. The host persists an idempotency key before calling the provider and preserves it across restarts. If the outcome is uncertain, we don't automatically retry. We also added a provider-status reconciliation hook and tested killing the process immediately after an external effect occurred. The effect wasn't duplicated or falsely marked as completed.