aicoolies logo
Magika logo
Magika logo

Magika

AI-powered file-type detection at Google scale

freeopen sourceupdated Apr 21, 2026

Open-source AI-powered file-type detection tool from Google that uses a custom deep-learning model under a few megabytes to identify more than 200 binary and textual content types in milliseconds, even on a single CPU. Magika ships as a CLI, Python package, JavaScript/TypeScript library, and an ONNX model, achieves around 99% accuracy on its test set, and is already used at Google scale across Gmail, Drive, and Safe Browsing as well as by VirusTotal and abuse.ch.

Magika is an open-source file-type detection tool from Google that replaces classic signature-based utilities with a compact deep-learning model. A custom model weighing only a few megabytes and trained on roughly 100 million samples across more than 200 content types identifies binary and textual formats in milliseconds on a single CPU. The project reports around 99% accuracy on its test set and already powers file-type routing at Google scale — Gmail, Drive, and Safe Browsing rely on it to send hundreds of billions of samples per week into the right security and content-policy scanners.

The tool is deliberately polyglot. A Rust-powered CLI lets you run `magika file.bin` on a server or developer machine; the Python package exposes a `Magika` class with streaming APIs and scoring thresholds; a JavaScript/TypeScript package targets Node and browsers for client-side detection; and the underlying Keras-trained ONNX model can be embedded in any language with an ONNX runtime. Magika has been integrated with VirusTotal and abuse.ch and is commonly used as a pre-filter in malware-analysis pipelines, data-lake ingestion, DLP tools, and forensic triage where GNU `file` and libmagic fall short on obfuscated or renamed inputs.

For AI-infrastructure teams Magika slots in wherever you need fast, language-agnostic content detection without external calls. It is Apache-2.0 licensed so it can ship inside commercial products, it runs offline so it is safe in regulated environments, and it returns a rich label plus a confidence score that you can threshold per use case. Typical deployments put Magika in front of virus scanners, attachment filters, LLM upload pipelines, and automated reverse-engineering workflows — anywhere a wrong file-type guess would send a file to the wrong processor. The project is actively maintained by Google's security team on GitHub with regular model and dataset updates.

Pricing

Free and open source (Apache-2.0) — no paid tier, no hosted SaaS

Platforms

CLI (cross-platform), Python package, JavaScript/TypeScript package, and ONNX model embeddable in any language

Categories

Tags

Use Cases

Related Tools

Anamorpher parent Trail of Bits mark

Anamorpher

Craft image-scaling prompt-injection payloads to red-team multimodal AI systems

Open-source red-team toolkit from Trail of Bits that generates image-scaling attack payloads — images that look benign at full resolution but reveal a hidden prompt injection after a multimodal system downsamples them.

freeOpen Source
cai

CAI (Cybersecurity AI)

AI agent framework for offensive security and penetration testing

Alias Robotics' agent framework for building AI-driven offensive-security workflows — reconnaissance, exploitation, privilege escalation, and lateral movement — with multi-agent handoffs and human-in-the-loop control. Source-available, but the core is licensed for non-commercial research use only.

freemiumTelemetry
FiftyOne logo

FiftyOne

Open-source toolkit for curating datasets and evaluating visual AI models

FiftyOne is an open-source Python toolkit from Voxel51 for building high-quality datasets and better computer-vision and multimodal AI models. It pairs a browser-based visualization App with programmatic dataset curation, embeddings, similarity search, and model-evaluation workflows.

freemiumOpen SourceTelemetry
Open Notebook logo

Open Notebook

Private, self-hosted research notebooks with flexible AI models, source chat, and podcasts

Open Notebook is an MIT-licensed, self-hosted alternative to NotebookLM for collecting sources, chatting over research, generating reusable transformations, and producing multi-speaker podcasts. Its Docker stack keeps notebook data under the user's control while supporting 18-plus model providers, including local Ollama and LM Studio workflows.

Open SourceTelemetry
Hugging Face logo

Text Embeddings Inference

Hugging Face's open-source inference server for embeddings, rerankers, and classifiers

Text Embeddings Inference is Hugging Face's Apache-2.0 server for high-throughput embedding, reranking, and sequence-classification models. TEI packages token-based dynamic batching, optimized Transformers kernels, Safetensors loading, OpenAI-compatible embedding endpoints, Prometheus metrics, and configurable OpenTelemetry tracing in deployable CPU and GPU images.

Open Source
MEDUSA logo

MEDUSA

AI-first security scanner for LLM, agent, MCP, and RAG codebases

MEDUSA is an AGPL-3.0 AI-first security scanner from Pantheon Security that checks AI and machine-learning applications, LLM agents, MCP workflows, RAG pipelines, repository-poisoning risks, secrets, and agent-specific compromise patterns.

Open Source