# Magika AI File Type Detection and Content Classification

> Magika is Google's AI-powered file type detector for fast, content-based identification of binary and text files. It is useful when an agent needs safer routing, validation, triage, or downstream policy decisions based on the real file contents instead of just filenames or MIME headers.

- Skill: `agentskillexchange/magika-ai-file-type-detection-and-content-classification` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/magika-ai-file-type-detection-and-content-classification`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/magika-ai-file-type-detection-and-content-classification/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/magika-ai-file-type-detection-and-content-classification

---


# Magika AI File Type Detection and Content Classification

Magika is Google's AI-powered file type detector for fast, content-based identification of binary and text files. It is useful when an agent needs safer routing, validation, triage, or downstream policy decisions based on the real file contents instead of just filenames or MIME headers.

## Installation

Use the upstream install or setup path that matches your environment:
- pipx install magika
- brew install magika
- cargo install --locked magika-cli
- pip install magika

Requirements and caveats from upstream:
- [![image](https://img.shields.io/pypi/v/magika.svg)](https://pypi.python.org/pypi/magika)
- [![image](https://img.shields.io/pypi/l/magika.svg)](https://pypi.python.org/pypi/magika)
- [![image](https://img.shields.io/pypi/pyversions/magika.svg)](https://pypi.python.org/pypi/magika)

Basic usage or getting-started notes:
- Here is an example of what Magika command line output looks like:
- Magika is used at scale to help improve Google users' safety by routing Gmail, Drive, and Safe Browsing files to the proper security and content policy scanners, processing hundreds billions samples on a weekly basis....
- After the model is loaded (which is a one-off overhead), the inference time is about 5ms per file, even when run on a single CPU.

- Source: https://github.com/google/magika
- Extracted from upstream docs: https://raw.githubusercontent.com/google/magika/HEAD/README.md

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/magika-ai-file-type-detection-and-content-classification/)

