Skip to content
Back to skills

Mainframe Curl Requests

ASecurity

Bounded HTTP(S) requests with curl when a narrower client cannot provide the evidence.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 16, 2026
ai-agentsrustbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 16, 2026

npx -y skills add CATWILLgh/MAINFRAME --skill mainframe-curl-requests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mainframe Curl Requests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mainframe Curl Requests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/catwillgh-mainframe-curl-requests/badge)](https://www.skillsdirectory.com/skills/catwillgh-mainframe-curl-requests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mainframe-curl-requests
description: Bounded HTTP(S) requests with curl when a narrower client cannot provide the evidence.
---

# Bounded curl requests

Use curl as a transport tool, not as authority to mutate an external system.
Before sending a request, establish the intended target and environment, the
endpoint contract, the operation's actual side effects, and the evidence the
response must provide. A diagnostic task does not authorize deployment, data
mutation, or another external side effect. Do not infer safety from the HTTP
method alone.

When a URL originates in untrusted content, validate its scheme, host, port,
and redirect boundary before requesting it. Prefer a purpose-built client when
it provides the required evidence with narrower access or safer authentication.

## Safe request defaults

- Check `curl --version` and the installed manual before relying on a
  version-sensitive option.
- Put `--disable` first so an uninspected user-level curl configuration cannot
  add credentials, proxies, redirects, output paths, or weaker transport
  settings. Omit it only when the assigned operation explicitly depends on a
  known configuration.
- Use HTTPS and constrain allowed protocols. Plain HTTP is acceptable only for
  a verified local plaintext service.
- Set both `--connect-timeout` and `--max-time` according to the operation's
  expected latency.
- Use `--fail` for HTTP failure detection when error bodies are unnecessary.
  It does not suppress successful bodies and can miss authentication failures.
  Discard unneeded bodies with `--output /dev/null` (Windows: `NUL`), or use
  `--out-null` when supported. Review needed, potentially sensitive bodies
  through an authorized protected output boundary before exposing them.
  Use `--fail-with-body` only when the error body is needed and safe to inspect.
- Use `-sS` for machine-oriented output. Capture the HTTP status separately
  with `--write-out` when the result must prove both transport and application
  behavior.
- Let `--data`, `--form`, and other data options choose their normal request
  method. Use `--request` only when the endpoint contract requires an explicit
  override.
- Remember that `-I` changes an HTTP request to HEAD, while `-i` keeps the
  selected method and includes response headers in output.

Example for a bounded HTTPS read:

```bash
curl --disable -sS --fail \
  --connect-timeout 3 \
  --max-time 15 \
  --proto '=https' \
  --write-out '\nHTTP_CODE:%{http_code}\n' \
  'https://example.invalid/resource'
```

Treat the process exit status, HTTP status, and expected response structure as
separate evidence. A successful transfer alone does not prove correct
application behavior.

The official [failure](https://curl.se/docs/manpage.html#--fail) and
[output](https://curl.se/docs/manpage.html#--output) contracts distinguish
HTTP error handling from response-body suppression.

## Authentication and output

When authentication is needed, use `mainframe-secrets` for credential resolution
and protected delivery. Public unauthenticated requests need no credential lookup.
Follow the exact authentication scheme recorded for the resolved
service; never assume Bearer authentication.

Prefer native authentication or process-scoped `mainframe-secret run` delivery. Do not
show the expanded secret-bearing command. Never read a credential file such as
`.netrc`, even when curl may consume it natively.

With authenticated requests, do not expose request headers, cookies,
environment dumps, authenticated URLs, or command traces. Do not use
`--verbose`, `--trace`, or `--trace-ascii` unless their output is kept outside
model context and safely redacted before inspection. Do not return an
unreviewed response body that may contain credentials or private data.

If the available consumer interface cannot accept a credential without
exposing it, report that exact limitation instead of improvising a new storage
or delivery mechanism.

## Redirects

Do not follow redirects automatically when a request carries authentication or
another sensitive custom header. Inspect the redirect target first. Curl can
send headers supplied with `--header`, including custom API-key headers, on
redirected requests to another host.

When redirects are required and every destination is trusted, bound their
count and allowed protocols, for example:

```bash
--max-redirs 3 --proto-redir '=https'
```

Do not use `--location-trusted` unless forwarding authentication across the
redirect boundary is explicitly required and every destination has been
verified.

## Retries

Retry only when the operation is safe to repeat or the API provides a verified
idempotency mechanism. Check the installed curl manual for the actual transient
error set instead of relying on a fixed remembered list.

Bound retry time with `--retry-max-time` as well as bounding each attempt with
`--max-time`. Do not use `--retry-all-errors` by default. Do not retry an upload
or state-changing request when it is unknown whether the server accepted the
first attempt.

## TLS and local files

Do not use `--insecure` to make a remote request succeed. For an assigned local
self-signed service, prefer its CA certificate. If an explicitly authorized
insecure probe is the only available diagnostic, label its result as limited
evidence rather than proof of valid production TLS.

For uploads and downloads, resolve the exact local path before execution. Do
not overwrite an existing file without authority. Keep credentials out of URLs,
query strings, filenames, and generated metadata. When the response content or
size is unknown, save it to a bounded temporary location and inspect it before
assigning a final user-owned path. Do not trust a server-provided filename
without validation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.