Code Migrator system card

Defines the intended use, model, data flow, agent tools, output checks, human oversight, and known limits of Code Migrator, so that you can assess it against your AI governance requirements.

About this card

Cloudera Migration Assistant does not include a model. Code Migrator uses the model that your LLM endpoint provides, so this card describes the system around the model, not the model itself. For the model card of the model that you use, see the documentation of its provider.

Intended use

Code Migrator refactors Spark and Airflow projects written in Java, Python, or Scala, so that they run on a target version. It is intended for use during a migration with Cloudera Migration Assistant, by users with the cma-migrator role. It writes its changes to a new Git branch, for a person to review before the changes are merged.

Code Migrator is not intended for these uses:

  • Changing code other than Spark and Airflow projects
  • Merging or deploying its changes without a review by a person
  • Refactoring code that you do not trust
  • Testing the migrated Spark jobs, which Code Migrator does not run

For how to use Code Migrator, see Code Migrator.

Model

Table 1. Model of Code Migrator
Property Value
Model Not included. An administrator sets the endpoint URL, the API key, and the model name in the engine configuration. You are responsible for evaluating and selecting the model.
Endpoint Any endpoint that is compatible with the OpenAI API. It can be a public LLM service or an LLM gateway inside your own network.
Agents All the agents of Code Migrator use the same model.
Startup check When the Code Migrator service starts, it runs a short test conversation to check that the model can call tools, and logs the result. The check does not block the service.

For how to set up the endpoint, see Configuring LLM connection.

Components

Code Migrator consists of the Code Migrator service, the documentation search service, the built-in Git server, and a build sandbox for each job. The Cloudera Migration Assistant server provides the Refactor page, the REST API, and the database. The LLM endpoint is not part of Cloudera Migration Assistant. For the role of each component, the agents, and the security controls, see Code Migrator reference.

Data sent to the LLM

Code Migrator sends this data to the LLM endpoint:

  • The source code of the project: the original files, and the files that it changes
  • The build files of the project, such as pom.xml and build.sbt
  • The output of builds, tests, and validation, including error messages
  • The results of the tools that the agents call, such as file contents and search results
  • The migration plan of the job
  • The target settings of the job, such as the target virtual cluster and the Spark configuration
  • The text that you enter in Additional context
  • Notes from earlier successful jobs that migrated the same kind of workflow between the same versions

Before each request, Code Migrator replaces values that look like secrets with placeholders. It puts the real values back only when it writes a file or runs a tool. The detection is based on patterns, so a secret that matches no pattern is sent to the LLM. Remove secrets from the code before you start a job.

Code Migrator does not send Git credentials or the LLM API key to the LLM. Searches of the documentation search service stay inside the cluster. If the LLM endpoint is outside your network, the data that Code Migrator sends to the LLM leaves your network.

Data received and stored

The LLM returns text and tool calls. When a job ends, the orchestrator returns a summary of the result and a list of open issues. Code Migrator changes files only through the tools of its agents.

Cloudera Migration Assistant stores this data:

  • Database – The job, its migration plan, its result, its token counts, the changes of each iteration, and the conversation history of its agents. The history holds the instructions, the prompts, the responses of the LLM, and the names of the tools called. It does not hold the results of the tools.
  • Git – Each iteration is committed to the work branch of the job in the built-in Git server. Each commit names Cloudera Migration Assistant and the model in its message. See Commit attribution and AI disclosure.
  • Notes from earlier jobs – After a successful job, the LLM writes a short summary of what it learned. Code Migrator keeps it, and gives it to later jobs that migrate the same kind of workflow between the same versions. It removes lines that name values of the target settings.
  • Logs – Code Migrator does not log the full prompts by default. For each request to the LLM, it writes an audit record with the model, the size of the prompt, the outcome, and the job ID, but no prompt text and no code. See Telemetry and audit logging.

Tools that the agents can call

Each agent of Code Migrator can call only the tools that it is given:

  • Orchestrator – Calls the other agents, gets the status of the job, and ends the job.
  • Planning agent – Lists, reads, and searches the files of the job, writes the migration plan, searches the documentation search service, and checks Airflow code against the Airflow rules.
  • Migration agent – Reads and edits the files of the job.
  • Build agent – Builds the migrated project with Maven, Gradle, sbt, or Python.
  • Validation agent – Runs the validation of the migrated project, and applies the automatic fixes of the ruff linter.
  • Spark job collector – Lists, reads, and searches the files of the job.

No agent has shell access, and the only network service that the agents can reach is the documentation search service. The file tools work only inside the working directory of the job. The build and validation tools run fixed commands in the build sandbox, and filter the arguments that an agent passes to them.

Output validation

Code Migrator checks its output after each change:

  • Build – Builds the project with Maven, Gradle, or sbt. For a Python project, it compiles the Python files.
  • Validation – For an Airflow 3 target, runs the Airflow rules of the ruff linter. For a Maven, Gradle, or sbt project, runs the tests of the project if it has any.

These checks have limits:

  • Code Migrator does not run pytest tests.
  • A PySpark project with no build file is checked only for Python syntax.
  • Code Migrator does not run the migrated Spark jobs, so the checks do not show whether the jobs return the same results as before.
  • The build agent and the validation agent report the results of the checks. A job that succeeds is not proof that the code is correct.

Human oversight

Code Migrator relies on a person to review its output in these ways:

  • Code Migrator writes only to a new work branch. It never changes the branch or commit that you started from, and never merges the work branch.
  • When you create a refactor job, you cannot finalize it until you confirm in the AI use card that you will review the changes before they are merged.
  • In a migration plan, the manual Review code changes step comes before the Finalize changes step, which merges the work branches. See Migrating Cloudera Data Engineering Spark jobs.
  • On the Refactor page, you can review each iteration, its changes, the migration plan, and the conversation history of the agents. You can cancel a job at any time, and retry it with different settings.

Known limits

Code Migrator has these limits:

  • Code Migrator does not detect prompt injection. Text in the code, in its comments, or in Additional context reaches the LLM, and can change what the agents do. The tool limits and the build sandbox restrict the effects, but you must review every change.
  • The endpoint URL can use HTTP or HTTPS. Use HTTPS.
  • Secret detection is based on patterns, and can miss secrets.
  • The output can be wrong or incomplete even when the build and validation pass.

Security testing

Before each release, Cloudera reviews the security architecture of Cloudera Migration Assistant, including a threat model of Code Migrator. Automated tests cover authentication, secret redaction, file path limits, build file checks, and the build sandbox.

For the security controls of Code Migrator, see Code Migrator reference. For the security of Cloudera Migration Assistant as a whole, see Security overview for Cloudera Migration Assistant.