Metadata-Version: 2.4
Name: metaclean-vlm
Version: 0.1.0
Summary: Remove metadata from image datasets before VLM training or ingestion to reduce hidden prompt injection risk.
Project-URL: Repository, https://github.com/edujbarrios/metaclean-vlm
Project-URL: Issues, https://github.com/edujbarrios/metaclean-vlm/issues
Author-email: "Eduardo J. Barrios" <edujbarrios@outlook.com>
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: >=3.10
Requires-Dist: pillow>=10.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# metaclean-vlm

Remove metadata from image datasets before VLM training or ingestion to reduce hidden prompt injection risk.

![PyPI](https://img.shields.io/pypi/v/metaclean-vlm)
![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)

## Installation

```bash
pip install metaclean-vlm
```

## Usage

```python
from metaclean_vlm import clean_images

report = clean_images("raw_images", "clean_images")
print(report)
```

## Bulk clean a dataset

```python
from metaclean_vlm import clean_dataset

report = clean_dataset("dataset/raw", "dataset/clean")
print(report)
```

`clean_dataset` recursively processes supported images and preserves folder structure.

## Output

```python
[
    {
        "input": "raw_images/example.jpg",
        "output": "clean_images/example.jpg",
        "format": "JPEG",
        "metadata_found": True,
        "metadata_keys": ["exif", "icc_profile"],
        "ok": True,
        "error": None,
    }
]
```

## Clean one image

```python
from metaclean_vlm import clean_image

result = clean_image("image.jpg", "image.clean.jpg")
print(result)
```

## Inspect metadata

```python
from metaclean_vlm import inspect_metadata

metadata = inspect_metadata("image.jpg")
print(metadata)
```

## Overview

`metaclean-vlm` is a tiny Python utility for removing metadata from image datasets before they are used in VLM pipelines. It is aimed at reducing the risk of hidden prompt injection or unwanted instructions stored in image metadata.

It is useful when building:
- VLM training datasets
- multimodal AI pipelines
- image ingestion systems
- dataset cleaning workflows
- AI safety preprocessing tools

## Features

- Removes common image metadata
- Cleans batches and full image datasets
- Supports JPEG, PNG, WEBP, TIFF, and BMP
- Preserves folder structure
- Returns a simple cleaning report
- Uses Pillow
- Simple API

## Limitations

`metaclean-vlm` removes metadata by re-encoding image pixels without metadata fields. It is not a complete security scanner and does not protect against steganography, visible prompt injection, OCR-based attacks, adversarial images, poisoned pixels, or malicious image content. Use it as one dataset hygiene layer, not as your only security control.

## Issues

Report issues at:
https://github.com/edujbarrios/metaclean-vlm

## Author

Eduardo J. Barrios  
edujbarrios@outlook.com

## License

Mozilla Public License 2.0
