Skip to content

feat: add CPython-native intercept layer to prevent agentic RCE (#129) - #184

Open
anchi205 wants to merge 1 commit into
xai-org:mainfrom
anchi205:feat/safety-audit-hooks
Open

feat: add CPython-native intercept layer to prevent agentic RCE (#129)#184
anchi205 wants to merge 1 commit into
xai-org:mainfrom
anchi205:feat/safety-audit-hooks

Conversation

@anchi205

Copy link
Copy Markdown

Pull Request Title

feat: add CPython-native intercept layer to prevent agentic RCE (#129)

Checklist

  • I have read both the CONTRIBUTING.md and Contributor License Agreement documents.
  • I have created an issue or feature request and received approval from xAI maintainers. (minor changes like fixing typos can skip this step)
  • I have tested my changes locally and they pass all CI checks.
  • I have added necessary documentation or updated existing documentation.

Description

Introduce xai_sdk.safety using PEP 578 audit hooks as a deterministic runtime guardrail for applications processing untrusted real-time data. SafetyGuard context manager intercepts dangerous operations (subprocess, exec/eval, network, filesystem) at the OS boundary with per-thread scoped enforcement and zero overhead outside guarded sections.

Related Issue

#129

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please specify)

…org#129)

  Introduce xai_sdk.safety using PEP 578 audit hooks as a deterministic
  runtime guardrail for applications processing untrusted real-time data.
  SafetyGuard context manager intercepts dangerous operations (subprocess,
  exec/eval, network, filesystem) at the OS boundary with per-thread
  scoped enforcement and zero overhead outside guarded sections.

Signed-off-by: Anchita Borah <anborah@redhat.com>
@anchi205
anchi205 requested a review from a team as a code owner July 24, 2026 16:14
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.

1 participant