Skip to main content

SemFire (Semantic Firewall): detect advanced AI deception, including in-context scheming and multi-turn manipulative attacks.

Project description

SemFire Logo

SemFire

CI

AI Deception Detection Toolkit

SemFire (Semantic Firewall) is an open-source toolkit for detecting advanced AI deception, with a primary focus on "in-context scheming" and multi-turn manipulative attacks. This project aims to develop tools to identify and mitigate vulnerabilities like the "Echo Chamber" and "Crescendo" attacks, where AI models are subtly guided towards undesirable behavior through conversational context.

Project Vision: A Toolkit for AI Deception Detection

History

SemFire aims to be a versatile, open-source toolkit providing:

  • A Python library for direct integration into applications and research.
  • A Command Line Interface (CLI) for quick analysis and scripting.
  • A REST API service (via FastAPI) for broader accessibility and enterprise use cases.
  • Core components that can be integrated into broader semantic-firewall-like systems to monitor and analyze AI interactions in real-time.

Features

  • Rule-based detector (EchoChamberDetector) for identifying cues related to "in-context scheming," context poisoning, semantic steering, and other multi-turn manipulative attack patterns (e.g., "Echo Chamber", "Crescendo").
  • Analyzes both current text input and conversation history to detect evolving deceptive narratives.
  • Heuristic-based detector (HeuristicDetector) for signals like text complexity and keyword usage.
  • ML-based classifiers to enhance detection of complex scheming behaviors over extended dialogues (Future Work).
  • Free API Image
  • Enterprise API in Alpha

Installation

The project can be installed from PyPI:

pip install semfire

🆕 ATT&CK v18 Navigator Integration (NEW!)

SemFire now supports MITRE ATT&CK v18 with Detection Strategies.

  • Detection Strategies: 3 behavior-focused approaches
  • Analytics: 8 platform-specific detections with tunable parameters
  • Log Sources: 8 LLM-specific sources (v18 naming)
  • Custom Techniques: T1656–T1659 for LLM attacks

Quick Start

from integrations.navigator.semfire_navigator_v18_adapter import SemFireNavigatorV18Adapter
from datetime import datetime

adapter = SemFireNavigatorV18Adapter()
# ... run SemFire analysis ...
adapter.add_detection(result)

# NOTE: To avoid overwriting files, consider using a timestamp in the filename.
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
output_filename = f"output_{timestamp}.json"
adapter.save_layer(output_filename)

Terminal Demos (GIFs)

Examples

The following terminal demo GIFs are available under assets/demos/asciinema/:

Quick Start

demo

Individual Detectors

demo

Python API

demo

Complete Workflow

demo

API: Health/Ready/Zip Analyze

demo

Progressive Scores (Benign → Adversarial)

demo

CLI Adversarial Conversation (Multi-turn)

demo

Live Streamlit Demo

Explore the interactive Streamlit UI for SemFire:

Notes:

  • The Streamlit UI lives in the companion repository under demos/streamlit/ and uses this backend.
  • For local development, run streamlit run demos/streamlit/app.py from the companion repo after installing this package.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semfire-0.4.0.tar.gz (14.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semfire-0.4.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file semfire-0.4.0.tar.gz.

File metadata

  • Download URL: semfire-0.4.0.tar.gz
  • Upload date:
  • Size: 14.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for semfire-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3f915cd35e84594790ead0260d6a898e76a75df764c6994265a92cc5c394610e
MD5 7f7bbf268ce67dbaed161e68f2e96a7b
BLAKE2b-256 a03af0c4e2f29c1636a5e865936d77d52b543e3b1988a7adfad339b6e296aae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for semfire-0.4.0.tar.gz:

Publisher: release.yml on Hyperceptron/SemFire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file semfire-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: semfire-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for semfire-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16719b043799f71445a86c3cf6cd24a3779fa87b0322da60f3a54c967392065c
MD5 ed5a8b4380a647bc6176ac07fdb3dd6c
BLAKE2b-256 74b5490743af053a157370e727eb9f4d3ccd42cad6b477147a1e58cae485d630

See more details on using hashes here.

Provenance

The following attestation bundles were made for semfire-0.4.0-py3-none-any.whl:

Publisher: release.yml on Hyperceptron/SemFire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page