selinux-agent-confinement

Generate SELinux policy modules to confine AI coding agents on Fedora/RHEL systems.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/WarGloom/opencode-selinux --skill selinux-agent-confinement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: selinux-agent-confinement
Source: https://github.com/WarGloom/opencode-selinux/tree/main/.claude/skills/selinux-agent-confinement
Command: npx skills add https://github.com/WarGloom/opencode-selinux --skill selinux-agent-confinement

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the security risks of AI coding agents accessing sensitive user data by creating SELinux policies to confine their access to specific directories.

Core Features & Use Cases

  • SELinux Policy Creation: Generates SELinux policy modules (.te, .fc, .if) for confining AI agents.
  • Access Control: Restricts agents to explicitly labeled project directories while protecting the rest of the home directory.
  • Use Case: You want to use an AI coding assistant like opencode or aider but are concerned about it accessing your SSH keys or personal documents. This skill helps you set up SELinux rules to ensure the agent can only interact with your project files.

Quick Start

Use the selinux-agent-confinement skill to set up SELinux rules for the opencode agent on Fedora.

Frequently Asked Questions about selinux-agent-confinement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict an AI coding agent from accessing sensitive files in my home directory with SELinux?

SELinux confinement restricts AI coding agents by generating policy modules that define process domains and workspace file labels, ensuring agents only access explicitly labeled project directories while protecting personal data like SSH keys.

Can I create SELinux policies for AI agents on Fedora and RHEL systems?

You can create SELinux policies for AI agents on Fedora and RHEL by generating .te, .fc, and .if policy modules that define executable entrypoints and manage file context strategies for secure agent operation.

What is the best way to confine tools like opencode or aider using SELinux?

The best way to confine tools like opencode or aider is creating SELinux policy modules that label specific project directories, restricting the agent process domain to only interact with workspace files while blocking broader home directory access.

Does SELinux agent confinement resolve file relabeling issues when updating project files?

SELinux agent confinement addresses relabel-on-update issues by managing file context strategies within the policy module, ensuring workspace file labels persist correctly during project updates and shared path conflicts with containers are handled.

Why does my SELinux policy conflict with containers sharing the same project paths?

SELinux policies conflict with containers on shared paths because both attempt to enforce separate file context labels on the same directories, requiring specific file context strategies within the policy module to resolve access denials.

What permissions does an SELinux policy need to allow an AI agent to function properly?

An SELinux policy needs essential permissions defined within the agent process domain to allow executable entrypoints, workspace file read/write access, and directory traversal while maintaining confinement to explicitly labeled project paths.