aegis kernel guard
by Aditya Verma
Deterministic zero-trust security runtime to block prompt injection and path traversal in <0.016ms.
$29
aegis kernel guard
Example session with this skill installed
Protect my file-writing tool so it can only write to the ./dist folder and cannot execute any shell commands.
- Read your context and instructions
- Compiled the aegis kernel guard
I have configured the AegisKernel security harness to restrict your tool's capabilities. The implementation uses a deterministic token that blocks all shell execution and limits file writes to the ./dist directory.
Security Configuration
from aegis import SecurityKernel, CapabilityToken
# 1. Initialize kernel scoped to the project root
kernel = SecurityKernel(workspace_root=".")
# 2. Define the restricted capability token
# This explicitly denies shell access and restricts write operations
secure_token = CapabilityToken(
allow_read=["./src", "./config"],
allow_write=["./dist"],
allow_shell=False
)
def safe_file_writer(target_path: str, content: str):
"""
Wraps file operations in a zero-trust runtime harness.
Intercepts path traversal and unauthorized writes in <0.016ms.
"""
command_intent = f"write {target_path}"
# Deterministic AST/POSIX layer validation
is_safe, reason = kernel.verify_command(command_intent, token=secure_token)
if not is_safe:
# Blocks execution before the system call reaches the OS
raise PermissionError(f"[AegisKernel BLOCKED] {reason}")
return kernel.execute_safe(f"echo '{content}' > {target_path}")
# Example usage that would be blocked:
# safe_file_writer("../.env", "malicious data") -> Raises PermissionError
Next steps
- Run
pip install aegis-kernelto install the runtime. - Execute
python scripts/verify_sandbox.pyto test the containment boundary. - Apply this wrapper to any tool handling untrusted input from external APIs.
Connects securely to your tools. The creator never sees your data.
About this skill
LLM-based guardrails are too slow and expensive for real-time security. They add hundreds of milliseconds of latency and drain your token budget while still failing against sophisticated prompt injection. AegisKernel provides a deterministic security runtime that intercepts dangerous tool calls at the system level.
What it does
- Zero-latency interception blocks malicious commands in under 0.016ms without secondary LLM calls.
- Strict workspace containment prevents directory traversal and unauthorized access to files outside defined roots.
- Subshell protection identifies and drops interactive shell spawning and reverse shell attempts.
- Capability-based access ensures tools only execute actions explicitly allowed by their assigned tokens.
- Injection mitigation sanitizes untrusted input from web scrapes or user uploads before they reach the OS.
How it works
- Initialize the
SecurityKernelby defining your project workspace root to set the primary boundary. - Define tokens to specify granular permissions for file reads, writes, and shell access for each tool.
- Wrap tool calls using the
verify_commandmethod to validate AST and POSIX layers before execution. - Execute safely through the kernel to ensure all system calls remain within the verified blast radius.
Frameworks & tools
This skill integrates with Python-based agent frameworks, claude-code, and Cursor. It requires the aegis-kernel library and works at the POSIX and AST layers to provide runtime protection for shell and filesystem operations.
Why this beats prompting it yourself
System prompts telling an agent to "be secure" are easily bypassed by indirect prompt injection. AegisKernel moves security from the fragile "logical" layer of the LLM to the "deterministic" layer of the code, making escapes computationally impossible.
Use cases
- Web-scraping agents that must process untrusted HTML without triggering remote code execution.
- Auto-coding agents requiring restricted filesystem access to prevent accidental deletion or sensitive data leaks.
- Multi-agent swarms where subagents need strictly limited capabilities to prevent privilege escalation.
- Enterprise deployments where autonomous agents handle sensitive
.envfiles or production credentials.
Known limitations
Requires the aegis-kernel Python package. It is designed for POSIX-compliant environments and focuses on tool-call security rather than network-level firewalls.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 16 days ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.