HCC AI Coding Agent Best Practices
These guidelines help HCC users operate AI coding agents responsibly while protecting shared computing resources. Users are responsible for agent activity on their behalf and should follow these practices alongside existing HCC policies.
General Behavior¶
- Actively supervise AI coding agents. Users should supervise agents during active sessions and avoid leaving them running unattended. Users remain responsible for actions performed on their behalf. Agent activity should stay focused on the stated task and relevant project.
- Approve changes in scope. Expanding filesystem, compute-resource, or access scope beyond the original task requires explicit user approval before execution.
- Pause or end unattended sessions. Users should pause or end an active session when they cannot monitor or intervene in agent activity.
Running Agents and Login Nodes¶
- Run agents on compute nodes, not login nodes. AI coding agents must run on compute nodes through Slurm allocations and must be launched from project directories under
/work. They must not run on HCC login nodes or be launched from/home. - Verify where commands execute. Users should verify where agent commands execute, including when using SSH or remote development tools.
Filesystem Safety¶
- Keep routine file operations within the active project. Routine file inspection and editing, review of task-related source code, logs and job output, and small checks such as
ls, targetedrg, syntax checks and compile checks should remain within the active project. Users should favor known paths andmodule avail/module spiderover broad filesystem discovery. - Get approval for broad recursive searches. Broad recursive searches using
find,grep,rg,du,ls -Ror equivalent tools require explicit user approval. Unrestricted recursive scanning of HCC shared filesystems must not occur. - Limit exploratory traversal and processing. Users should monitor potentially expensive exploratory directory traversal and recursive processing, including source-tree checks. These operations should be limited to five minutes of wall time unless a longer, defined limit has been approved in advance.
- Stop operations that exceed their approved limits. Operations exceeding their agreed time or scope should be stopped, not repeatedly restarted or expanded. If a safe search scope cannot be established, users should stop and contact HCC support.
Storage and Data Handling¶
- Stay within authorized project data. Users should keep agent file operations within authorized project data and watch for unnecessary traversal of shared storage. Launching from
/workdoes not authorize changes to unrelated files or shared group data. - Approve changes to important files. Deleting, overwriting or moving important files requires explicit user approval before execution.
- Approve shared-data and permission changes. Modifying shared group or project data, or changing file or directory permissions or ownership through
chmod,chownor ACL changes, requires explicit user approval.
Slurm and Compute Resources¶
- Get approval before submitting jobs. Agents may prepare or modify task-related Slurm job scripts, but submission requires separate user approval. GPU, MPI, training, high-memory and high-I/O workloads must not run outside Slurm.
- Approve scheduler actions and resource increases. Submitting jobs with
sbatch, cancelling jobs withscancel, submitting large job arrays or many jobs, and substantially increasing CPU, memory, GPU, node count or requested walltime require explicit user approval. - Avoid uncontrolled job activity. Uncontrolled job submission, retries and job-array expansion must not occur. Agents must not bypass HCC scheduler or resource controls.
- Avoid excessive scheduler polling. High-frequency automated polling with
squeue,sacctorsinfomust be avoided. Repeated automated checks should be spaced at least five minutes apart; users should intervene if polling becomes excessive.
Software and Environment Management¶
- Keep routine environment checks within the task. Routine
module avail,module spiderandmodule loadoperations, and short Python, R, MATLAB or similar tests, should remain within the task and allocated compute resources. - Approve software installations. Installing software or packages in a user-managed environment requires explicit user approval.
- Approve shell and environment changes. Changing shell startup or environment configuration files, including
.bashrc, requires explicit user approval.
Repositories and Data Transfers¶
- Review changes before modifying remote repositories. Routine local Git inspection, such as
git statusandgit diff, should remain within the active project. Pushing, merging or otherwise modifying a remote repository requires explicit user approval. - Approve large-scale data transfers. Agent-initiated large-scale transfers into or out of HCC require explicit user approval before execution.
Security, Access, and Agent Safeguards¶
- Do not bypass access or resource controls. Agents must not bypass HCC authentication, filesystem permissions, Slurm scheduling or resource controls. Users must not enable unrestricted or permission-bypass agent modes.
- Protect credentials. Agents must not read, inspect, display, copy, log, disclose or transmit private SSH keys, passwords, API tokens or other credential contents. They must not extract these contents from configuration files, environment variables or credential stores, or expose them in prompts, outputs, logs or external requests. Users should stop diagnostic operations that risk exposing credentials.
- Respect other users' resources and data. Agents must not access another user's private files, jobs, processes or credentials, or destructively modify another user's or group's data.
- Do not create unauthorized remote access. Unauthorized persistent remote-access or tunneling mechanisms must not be created.
User Review and Intervention¶
- Provide explicit approval for sensitive actions. Users should review the scope and potential impact of actions requiring approval and provide explicit authorization before execution. A general request to complete a task does not constitute blanket approval.
- Intervene when an agent exceeds its boundaries. Users should promptly intervene when agent operations become unauthorized, unbounded, unexpectedly resource-intensive or exceed an approved scope or time limit.
- Review longer-running operations in advance. A longer, clearly bounded exploratory runtime requires prior user review. Approval does not override HCC restrictions, and deliberate misuse may result in job termination or account restrictions.
- Contact HCC support when needed. If an operation cannot be safely scoped or stopped, users should end the agent session and contact hcc-support@unl.edu. HCC policies and administrator directions take precedence.