Data

Data resource describes any kind of artefacts in AI Toolkit; it could be a dataset, a function, a model, etc. A data resource has a latest branch and can have other named branches, which you push to, pull from and mount in jobs. Data has been designed for coordinating work among users and/or sharing data easily between users, resources and accounts.

We will describe the different concepts and types of operations through a series of examples. The premise is that we have a directory made up of octopus images as local initial dataset. This simple dataset is composed of two images.

tree octopus_dataset
octopus_dataset
├── 1.png
└── 2.png

0 directories, 2 files

Data Creation

The initial step is to create the data resource that will contain our octopus dataset, then push the directory content to it. eai data push uploads the current directory, so run it from inside the dataset directory.

# create the data resource
eai data new octopus

id                                   fullName         creator created              expiration ownerInherited classification
70d0d3e2-aec1-48d5-b9ff-f842cbe1cc96 acme.bob.octopus bob     2026-11-04T07:50:38Z -          bob

# push using the data id
cd octopus_dataset
eai data push 70d0d3e2-aec1-48d5-b9ff-f842cbe1cc96

Process file        : 1.png... 29 B
Process file        : 2.png... 29 B
Sent 58 B

# push using the data name
export ORG_NAME=$(eai organization get --field name)
export ACCOUNT_NAME=$(eai account get --field name)
eai data push $ORG_NAME.$ACCOUNT_NAME.octopus

Paths given on the command line keep their directory on the data resource: eai data push acme.bob.octopus octopus_dataset run from the parent directory stores octopus_dataset/1.png, not 1.png. See Pushing Data for more options.

Warning

Known issue (CLI 2.2.0 to 2.2.2): eai data new <name> <directory> creates the data resource but pushes nothing, and fails with lstat .../"<directory>": no such file or directory. Upgrade to 2.3.0, or create the data first and then run eai data push from the directory, as shown above.

Warning

To use data short name instead of data ID you must have set the name of your account, know your organization name and named your data resource.

# To give a name to your account
export ACCOUNT_ID=$(eai account get --field id)
eai account set $ACCOUNT_ID --name bob

Warning

From here instead of using the data ID we will use the data short name. A short name is composed of the organization name (acme for our exemple), an account name (bob) and a data name (octopus).

acme.bob.octopus

To view all the data resources of an account:

# these two commands are equivalent
eai data ls 1100d30c-aec1-48d5-b9ff-f842cbe1cc96
eai data ls acme.bob

To view the branches of a data resource:

# {DATA_ID}
eai data branch ls 70d0d3e2-aec1-48d5-b9ff-f842cbe1cc96

# Data short name
eai data branch ls acme.bob.octopus

branch   version state
[latest] empty

A new data resource has a single branch, latest. To see the content of a branch, use eai data content ls with the data ID or name.

eai data content ls acme.bob.octopus@latest

name  status
1.png new
2.png new

If no branch is specified, latest is used.

eai data content ls acme.bob.octopus

name  status
1.png new
2.png new

Pushing Data

Compression

eai data push compresses each chunk with zstd before sending it. Chunks that don’t get smaller, such as already-compressed images or archives, are sent uncompressed. There is no flag; it is always on. The data is stored uncompressed, so pulls and jobs see the original files.

Resuming an interrupted push

When a push fails or is interrupted with Ctrl-C, the CLI prints a command that resumes it with the same session:

To resume this push, run:
  eai data push acme.bob.octopus --resume 1259f34f6be34e00

Run it from the same directory. Chunks that were already uploaded are skipped. After eai data new <name> <directory>, the command starts with cd <directory>. No command is printed after an error that resuming can’t fix, such as an unknown branch.

Note

In CLI 2.2.2 and earlier, interrupting a push with Ctrl-C prints no resume command. Run the push with --verbose to see the session id in the first line ([push] session 1259f34f6be34e00: starting ...), and pass it to --resume.

Partial pushes

eai data push also accepts files and directories to push, --files-from <file> to read the list from a file or stdin, --flatten to drop the directory structure, --remote-root <dir> to push under a remote directory, and --allow-rename to rename on push with <src>:<dst>. See eai data push --help and eai data push.

Pulling Data

# pull the whole data resource
eai data pull acme.bob.octopus ./octopus_copy

Download 58 B successfully

# pull one file, renamed on download
eai data pull acme.bob.octopus 1.png:one.png ./single

Whole-resource pulls download in parallel chunks, compressed with zstd when the server supports it, and are resumable: --chunk-size and --parallelism tune the download, and an interrupted pull prints a command that resumes it with --session <id> --resume-from <chunk>. Against an older server, the CLI falls back to a single-stream download. Pulling a specific file or directory, or renaming on pull (<src>:<new>), always uses the single-stream download.

Warning

Known issue (CLI 2.2.0 to 2.2.2): every eai data pull uses the single-stream download, including whole-resource pulls. --chunk-size, --parallelism, --session and --resume-from have no effect, no resume command is printed, and an interrupted pull starts again from the beginning. Upgrade to 2.3.0.

Data Expiration

You can create data objects with an expiration date or duration. After the specified time, the data object will be deactivated first, then completely removed from storage immediately.

Using an absolute expiration date:

eai data new snow.bob.octopus01 --expiration 2025-12-01

Using a relative duration:

eai data new snow.bob.octopus01 --duration 10d

Note

The duration format supports: y (years), M (months), d (days), h (hours), m (minutes), s (seconds), ms (milliseconds), us (microseconds), ns (nanoseconds).

Warning

Once a data object expires and is removed, the data cannot be recovered. Ensure you have backups if needed.

Branches and Versions

Every data resource has a latest branch. You can add named branches, then push to, pull from and mount a branch with @<branch>.

# add the branch v1 (from latest when no version is given)
eai data branch add acme.bob.octopus v1

# list the branches
eai data branch ls acme.bob.octopus

# push to the branch, list it and pull it
cd octopus_dataset
eai data push acme.bob.octopus@v1 1.png
eai data content ls acme.bob.octopus@v1
eai data pull acme.bob.octopus@v1 ./octopus_v1

A push to a branch that doesn’t exist fails with branch not found: v1.

Warning

Known issue: eai data branch add can fail with not found: version doesn't exist (HTTP 404), including on newly created data. This is under investigation.

To replace a file already present in the data, or to add a file under another name, rename it during the push with <src>:<dst> and --allow-rename. Without --allow-rename, every path is taken literally and keeps its name.

# run from the directory that contains newoctopus/
eai data push acme.bob.octopus@v1 --allow-rename newoctopus/octopus_1.png:1.png newoctopus/octopus_4.png:4.png

Committed versions

Earlier CLI versions had an alpha eai data commit command that froze a branch into an immutable version identified by a hash. It was removed in CLI 2.3.0, and new committed versions can no longer be created. Versions committed before that remain readable with @<version>, for example:

eai data pull acme.bob.octopus@0e02417491b79662a88da3b689a90da6 ./octopus_v0

Using data resources in jobs

To use data resources in a job, declare them as data mounts, optionally with a branch: --data acme.bob.octopus@v1:/dataset. A mount is read-write (:rw) by default; add :ro to mount it read-only. Multiple data can be mounted under a job.

# read-only, latest branch
eai job new --data acme.bob.octopus:/dataset:ro -i ubuntu:18.04 -- /bin/bash -c 'ls /dataset'

eai job logs -f --last
1.png     2.png

# read-write, branch v1
eai job new --data acme.bob.octopus@v1:/dataset:rw -i ubuntu:18.04 -- /bin/bash -c "touch /dataset/new_file && ls /dataset"

eai job logs -f --last
1.png     new_file

eai data content ls acme.bob.octopus@v1

name     status
1.png    new
new_file new

Removed commands and older data

CLI 2.3.0 removes eai data commit, eai data sync and eai data new --sync.

The server no longer accepts the legacy data upload and download routes, which older CLIs use for eai service new --upload and eai data run. Older CLIs get an HTTP 410 error on those routes:

this route was removed: upgrade eai-cli, or use eai data pull

From CLI 2.3.0, eai service new --upload uploads with eai data push, and eai data run downloads only eai.json.

Warning

With CLI 2.2.2, eai service new --upload crashes against the current server with fatal error: all goroutines are asleep - deadlock! instead of showing that error, and the service is created with an empty runtime. Upgrade to CLI 2.3.0 or later with eai upgrade.

Data uploaded through the legacy upload route can no longer be downloaded through the API, but jobs still mount it.

Data Classification

Data Classification defines the sensitivity level of a data resource and controls how it can be used and combined with other data in jobs and services.

Each data resource must be assigned a classification label that reflects the nature of the data it contains.

Why it Matters

Data classification helps to:

  • Protect sensitive and customer data

  • Prevent accidental data exposure

  • Enforce secure data usage in jobs and services

  • Ensure compliance with internal security policies

Without classification enforcement, sensitive data could be unintentionally copied into less secure datasets.

Classification Labels

The following classification labels are supported:

  • servicenow public – Non-sensitive data safe for broad access

  • servicenow internal restricted – Internal data with limited access

  • servicenow internal confidential – Highly sensitive internal data

  • customer restricted – Customer-owned or customer-sensitive data

  • research only – Data limited to research use

  • third party licensed – Data governed by third-party licenses

Note

servicenow public < servicenow internal restricted < servicenow internal confidential < customer restricted < research only < third party licensed (priority order)

Creating Classified Data

  • Classification can be specified during data creation:

eai data new acme.bob.octopus --classification "servicenow internal restricted"
  • Classification can also be updated later:

eai data set acme.bob.octopus --classification "research only"

Default Classification Behavior

Certain operations automatically assign default classifications to data:

  • Service Creation: During service creation, service-related default data is classified as servicenow internal restricted by default.

  • User Data Home Creation: During user data home creation, data is classified as servicenow internal restricted by default.

These defaults ensure that data is protected with appropriate access controls from the moment of creation.

Classification Usage Rules

Classification is validated and enforced at runtime when data is used in jobs and services.

The system enforces the following rule:

  • Data can flow to the same or higher classification

  • Data must never flow to a lower classification

Examples:

Read (Input)

Write (Output)

Result

Public

Restricted

Allowed

Restricted

Restricted

Allowed

Restricted

Public

Blocked

Confidential

Public

Blocked

Public

Public

Allowed

eai job new \
  --data acme.bob.restricted_data:/restricted:ro \
  --data acme.bob.public_data:/public:rw \
  -- cp /restricted/file.txt /public/file.txt

This job will be rejected because it attempts to write restricted data into public data (lower classification).

Best Practices

  • Always choose the correct relevant classification when creating data

  • Ensure job outputs have classification equal to or higher than inputs

  • Treat classification as a security boundary, not just metadata