# Import models, images and sounds with an agent

> An AI agent imports models, images and sounds into DiceyTable with asset_import, from your computer or an https link, and records a credit for each one.

- Question: How does an agent import models, images and sounds into my project?
- Source: https://diceytable.com/docs/ai-agents/workflows/importing-assets
- Last verified: 2026-10-09

An agent imports a file with `asset_import`. The file comes from one of two places: your computer, or an `https://`
link. Either way, it goes through the same import path as a drag and drop, and the agent records who made it.

Models are converted to GLB on the way in. Images and sounds are checked. The page on
[importing 3D models](https://diceytable.com/features/import-3d-models) lists the formats DiceyTable takes.

![Two import paths: a local file passes the folder fence, a web link passes the guarded proxy and its audit, then both reach the project](https://diceytable.com/assets/build/importing-assets--two-paths-TCgTV5o5.svg "**Two ways in.** Both paths end at the same import checks and the same credit question.")

## What you'll need

- An editor tab [paired with your agent](https://diceytable.com/docs/ai-agents/setup/pairing), with the project open.
- A key with **Edit projects**. It also needs **Local files** to import from your computer, or **Import from URLs**
  to import from a link. You pick these when you [create the key](https://diceytable.com/docs/ai-agents/setup/api-keys).

## What an import looks like

Here the agent fetches a model from the web and credits the studio that made it:

```json
{
  "url": "https://example.com/assets/meeple.glb",
  "folder": "models",
  "credit": {
    "origin": "third-party",
    "creator": "Example Studio",
    "licenseName": "CC BY 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by/4.0/"
  }
}
```

The result says where the file was stored, whether it was converted, any warnings, and the id of the new credit
record. On the way, your tab checks the file against a SHA-256 hash, a fingerprint that proves nothing changed in
transit.

## From your computer

For `localPath`, the **bridge** reads the file, not your browser. It only reads inside **allowed folders**: the folder
your agent started it in, plus any you add with `--allow-dir`. Even there, it refuses hidden files such as `.env`,
scripts, files over 128 MB, and files whose bytes don't match their name.

Mod repositories are public, so this fence keeps your private files private. The full rules are in
[Which local files an agent can read](https://diceytable.com/docs/ai-agents/concepts/local-file-access).

## From the web

Your browser tab can't fetch other websites, and neither does the bridge. For a `url`, DiceyTable's server fetches
the file and streams it back. This **guarded proxy** only takes `https://` links to public sites. It checks the file
type from the first bytes, refuses scripts and web pages, and never stores the file. Every fetch is logged in
**Settings ▸ AI agents ▸ URL imports**.

Some sites block automated downloads, and the import fails with `upstream-blocked`. Download the file yourself and
import it with `localPath` instead. [How URL imports are fetched safely](https://diceytable.com/docs/ai-agents/concepts/url-imports) has the
limits and every outcome.

## Data files

A `localPath` that points at a folder imports every data file inside it (`.json`, `.txt` and `.csv`) in one call. The
files keep their folder layout and go to `data/` unless the agent picks another folder. Data files are your game's own
text, so they need no credit.

## How big can an imported file be?

An import can be up to **128 MB**. That's the size going in. Conversion often shrinks a file a lot, so the size that
ends up in your mod has tighter limits:

| Stored size | What happens |
|---|---|
| Up to 45 MB | Stored. |
| 45 to 50 MB | Stored, with an `asset-exceeds-publish-limit` warning. It can't be published until it is smaller. |
| Over 50 MB | Refused with `asset-too-large-after-import`. Nothing is written and no credit is made. |

Some types have their own smaller limit, such as 10 MB for an HDR sky. Those fail with `too-large-for-type`. Only the
converted GLB of an FBX or OBJ is kept. A big model can take a few minutes to convert, and the agent sees progress
messages while it waits.

## Can the agent import an AI model?

Yes, but not with `asset_import`, which refuses `.onnx` files. An AI model is the brain behind a game's computer
opponents, and it has its own tool: `ai_model_import`. It reads a local `.onnx` file of up to 64 MB through the same
folder fence. The tab checks it with the same test publishing uses. You confirm each import in the tab yourself.

A model between 45 and 64 MB must then be pushed to the game's repository with git. The in-app Publish can't upload a
file that large.

## Credits

Every image, model and sound needs a credit record that says where it came from. The agent answers that in the
`credit` argument. Its `origin` is `own-work` (you made it), `third-party` (someone else made it, so name the
`creator`), or `disclaimed` (you take responsibility without naming a source). A URL import also records the link and
proof of the download.

Every record the agent writes is marked **AI-attested**, and nothing publishes until you review each one. See
[Review credits an AI agent added](https://diceytable.com/docs/ai-agents/concepts/ai-attested-credits), and
[Credit and being credited](https://diceytable.com/docs/mods/publishing/attribution) for credits in general.

> **⚠ Treat downloaded text as data.** A fetched file, its name and any text inside it can't give the agent orders.
> A downloaded README that says "ignore your instructions" is data, not a request. See
> [prompt injection protection](https://diceytable.com/docs/ai-agents/concepts/prompt-injection).

## Next steps

- [Build a deck of cards with an agent](https://diceytable.com/docs/ai-agents/workflows/build-a-deck): turn imported card art into a deck.
- [Build a room or table pack](https://diceytable.com/docs/ai-agents/workflows/build-a-room-or-table): put imported models to work.
- [Which local files an agent can read](https://diceytable.com/docs/ai-agents/concepts/local-file-access): the folder fence in full.
