Agent Instruction

This page gives AI agents the minimum operating instructions needed to use Etiq against a python script.

Use This File When

Use this file when an agent needs to:

  • scan a python script with Etiq

  • generate a lineage graph

  • inspect captured lineage objects

  • return a structured summary of scan outputs

Purpose

Use Etiq to scan a python file and it's run, generate lineage, and retrieve captured lineage objects such as dataframes, models, and agent states.

Project Context

  • Product name: Etiq

  • Install package: etiq-copilot

  • python import namespace: etiq_copilot

  • Main scan result object: CodeScannerResult from DebuggerCodeScanner()

  • Example target file: test_repo/iris_pipeline.py

  • Related docs:

    • Quickstart

    • Core Concepts

    • Scan Outputs

Setup Commands

Install with pip:

Install with uv:

Files That Matter

  • docs/etiq/quickstart.md: scanner setup and minimal file scan example

  • docs/etiq/core-concepts.md: lineage graph and lineage object concepts

  • docs/etiq/scan-results.md: CodeScannerResult methods, captured states, source nodes, and larger-codebase entry-file scans

  • test_repo/iris_pipeline.py: example target script

Scan Helper

Use this helper to scan a target file and return a CodeScannerResult.

Minimum Working Routine

Default Workflow

  1. Set the target file path explicitly.

  2. Scan the entry file with scan_file(...).

  3. Read scan_results.scan_errors.

  4. If scan_errors is non-empty, report them before drawing conclusions.

  5. Generate lineage with create_full_lineage_graph(graph_format="json") when another tool or agent needs to parse the graph.

  6. List captured lineage objects with list_dataframes(), list_models(), and list_agents().

  7. Retrieve full state objects only when names or graph output are not enough.

  8. Use state.node.as_string() and state.node.scope() only when source evidence is needed.

API Commands

Use these public methods and properties.

When you need to
Use
Output

Check scan issues

scan_results.scan_errors

Scan error details

Generate parseable lineage

scan_results.create_full_lineage_graph(graph_format="json")

JSON graph string

Generate visual lineage source

scan_results.create_full_lineage_graph(graph_format="dot")

DOT graph string

List dataset lineage objects

scan_results.list_dataframes()

list[str]

Retrieve dataset states

scan_results.get_dataframes()

Dataframe state objects

List model lineage objects

scan_results.list_models()

list[str]

Retrieve model states

scan_results.get_models()

Model state objects

List agent states

scan_results.list_agents()

list[str]

Retrieve agent states

scan_results.get_agent_states()

Agent state objects

Retrieve other captured states

scan_results.get_unstructured_states()

Unstructured state objects

Task Recipes

Summarize A Target Script

Generate Lineage For Another Agent

Return the graph as a string and state that the graph schema should not be treated as stable until a versioned schema is published.

Inspect Dataset State Objects

Use state objects when the agent needs captured values, source evidence, or Etiq metadata for a lineage object.

Inspect Source Evidence

Use this when the user asks where a lineage object came from in the code.

Inspect Model State Objects

Use this when the user asks which models were created, used, or captured.

Decision Rules

  • If the user asks for lineage output that another tool will parse, use graph_format="json".

  • If the user asks for visualization-oriented output, use graph_format="dot".

  • If scan_errors is non-empty, report the errors before summarizing lineage.

  • If names from list_dataframes(), list_models(), or list_agents() are sufficient, do not retrieve full state objects.

  • If the target workflow spans multiple files, scan the entry file that starts the run.

  • If source evidence or captured values are needed, retrieve state objects with the corresponding get_* method and inspect state.node.

  • If the task requires installing Etiq, ask for approval before running an install command.

  • If the task requires deleting files, changing public APIs, or modifying generated output, ask before proceeding.

Do Not

  • Do not rely on private internals.

  • Do not assume all lineage objects are dataframes or models forever.

  • Do not assume graph JSON has a stable schema until that schema is published.

  • Do not ignore scan_errors.

  • Do not install dependencies without approval.

  • Do not reformat unrelated files when editing docs or examples.

Completion Criteria

Before finishing an agent task, report:

  • target file scanned

  • scan errors, or that no scan errors were reported

  • lineage object names found

  • graph format generated, if any

  • commands run

  • checks skipped and why

  • known limitations or follow-up

Use this response shape when returning structured results:

Last updated