DEV Community

Cover image for Shirudo API Testing With Apidog CLI: Did the Shield Break Your API?
Hassann
Hassann

Posted on Originally published at apidog.com

Shirudo API Testing With Apidog CLI: Did the Shield Break Your API?

Shirudo API testing starts with two runs of the same staging scenario. Use Apidog CLI to capture a baseline before the shield loads, then rerun after the operator confirms the new shield is active. Compare status codes, response schemas and business outcomes case by case. Treat host enforcement evidence as a separate part of the rollout review.

Try Apidog today

What changes when you load a Shirudo shield?

Shirudo is a pre-release, open-source Linux security platform from OpenAI and Cisco. Its eBPF-based shields can restrict specific operating system behavior on a running host while you prepare a permanent patch. A legitimate API request can depend on the same operation, so test the application behavior before approving a wider rollout. OpenAI’s Shirudo announcement and Cisco’s launch notes describe the intended workflow.

The Shirudo repository calls its signed micropatches upatches. Its README documents a local VM option and separate production requirements, including a compatible kernel and TPM 2.0. Confirm the requirements for the version under evaluation before choosing your test host.

Think of the API and the host as two places to collect evidence. The API report shows what the client received and whether its workflow completed. The host record shows which shield state the operator verified. If a document upload starts returning a generic error, the status code alone can’t tell you whether the shield, a dependency or a gateway caused it. Matching request timestamps and checking application and host records gives the reviewer enough context to investigate.

A Linux vulnerability on an API server illustrates why the host matters even when your application’s routes stay the same. A middleware authentication bypass gives you a different boundary to test. Keep the tests for your app’s ordinary authentication and authorization behavior in the suite either way.

Build a baseline around real client workflows

Pick one client workflow that exercises the service the shield protects. Run it on staging with the same application build, fixture data and credentials you’ll use after the shield change. Assert the public response and the durable outcome. Include a routine error case so the comparison covers failures your clients already know how to handle.

Consider a document import service. A client submits a small document, polls for completion and fetches the result. A health endpoint can stay green while a background worker fails to finish that import. Give the worker a known-good fixture and check that the job reaches its terminal success state within the time your API promises.

Case Example expectation What to compare
Submit a valid document Returns the documented acceptance status and a job ID Status and required fields
Poll the created job Reaches the documented success state Terminal state and completion time
Fetch the result Returns the expected contents for the fixture Response shape and stable content
Submit an unsupported format Returns the documented validation error Status and machine-readable error code
Read with an expired test credential Returns the documented authentication error Status and error shape

Add a fixture that resembles your customers’ ordinary data, such as a permitted binary attachment or a filename with spaces, when your API supports it. A simple JSON happy path may bypass the code that processes an attachment. If your route accepts compressed input, include an ordinary supported file and verify its decoded result. The Node.js Brotli coverage is a reminder to include the paths that parse or transform input.

Keep the order of the steps fixed. Use a fixture namespace dedicated to this exercise and reset that fixture state between runs. Where the API assigns IDs, capture each new ID inside its own run and follow it through the workflow. The actual value can change. The ID must still reference the job you created, and that job must produce the expected result.

Sequence diagram showing document submission, status polling and result retrieval for a benign fixture

Run the before-and-after scenarios with Apidog CLI

Use Apidog CLI from your coding agent to run an existing document import scenario and save a report for each shield state. Give the agent the staging environment ID and confirm the target before it sends any requests. Keep the operator’s approval for the staging shield change between the two runs.

Install the CLI and sign in locally with an Apidog access token. Use a token with access to the test project and keep its value out of your prompt and reports. Have an existing staging environment and a saved scenario with the fixture assertions above. This walkthrough assumes the scenario is on your project’s main branch. If you work on a different branch, confirm it before running the test.

npm install -g apidog-cli@latest
apidog login --with-token "$APIDOG_ACCESS_TOKEN"
Enter fullscreen mode Exit fullscreen mode

Give your coding agent this prompt after you supply the staging project, environment and scenario name.

Use Apidog CLI to find the saved document import scenario and confirm the staging environment I supplied. Run the scenario with our benign fixtures and save the baseline JSON report. Record the exit status and wait for my confirmation that the operator verified the new shield state and reset the fixtures. Rerun the same scenario in the same environment and save the second report separately. Compare outcomes by case and assertion. Report new failures, missing checks and changes in completion time. Keep the shield and deployment under operator control.
Enter fullscreen mode Exit fullscreen mode

Your agent can start by listing the available scenarios and environments. Confirm that the scenario and environment belong to the intended staging project. If the names are ambiguous or the runner can’t reach staging, resolve that before taking a baseline.

apidog test-scenario list --project "$PROJECT_ID"
apidog environment list --project "$PROJECT_ID"
Enter fullscreen mode Exit fullscreen mode

Apidog CLI lists sandbox scenarios and environments, then shows an example baseline command

The capture shows a real sandbox lookup. Its scenario list is empty, so the baseline command is shown as a template. Run it with the saved scenario ID from your own staging project.

Use the resolved IDs for both runs. Run the first command, review the baseline, then let the operator make and confirm the staging change. Run the second command after the fixture reset. Use a fresh output location for each rollout review so an old report can’t be mistaken for a new result.

apidog run --project "$PROJECT_ID" --test-scenario "$SCENARIO_ID" \
  --environment "$STAGING_ENV_ID" --access-token "$APIDOG_ACCESS_TOKEN" \
  --reporters cli,json --out-dir ./shield-review/before \
  --out-file import-regression --on-error continue

apidog run --project "$PROJECT_ID" --test-scenario "$SCENARIO_ID" \
  --environment "$STAGING_ENV_ID" --access-token "$APIDOG_ACCESS_TOKEN" \
  --reporters cli,json --out-dir ./shield-review/after \
  --out-file import-regression --on-error continue
Enter fullscreen mode Exit fullscreen mode

The CLI reporter gives you a terminal summary. The JSON reporter gives your agent an artifact to compare. The --on-error continue option asks the runner to continue after an error. A later assertion that relies on a job ID can still fail because creation failed, so have the agent point to the earliest failing step. See the Apidog run command reference for reporter and environment options.

Ask for a compact comparison with the case name, baseline result, shielded result and the first changed assertion. Compare stable fields selectively. Requests, timestamps and generated identifiers can differ between runs for routine reasons. Preserve the original local reports so a reviewer can inspect the details behind the summary.

If you need to have another engineer review the comparison, assign the Apidog CLI run and its review as tasks in Sharkly, where your team’s coding agents run on your own computers. It’s free to start.

Decide whether the shield can move past staging

Approve a wider rollout only after the reviewer can account for the tested shield state, the expected API outcomes and any newly failing assertions. Attach the API comparison and the operator’s host evidence to the same review. If the baseline is already failing or the shield state can’t be verified, repeat the experiment after fixing the missing evidence.

Diagram showing before and after API reports feeding a case comparison that the reviewer checks against host evidence

A useful rollout record includes the application build, scenario and environment IDs, fixture version, host identity, shield revision and the time window for each run. Keep the test runner on the same network path across both runs. A traffic balancer that sends the second request to another host can make the two runs look equivalent even when the intended host was never exercised. If your API hands work to a separate worker, identify that host too.

Review skipped requests and missing assertions before you look at the pass rate. A second run with fewer checks can report a clean summary while leaving the main workflow untested. A refusal or timeout also needs context. Confirm whether the router, application or dependency produced it and compare the failure with its corresponding baseline step.

Treat a difference in latency as a lead. If the first run used a warm worker and the second started with a cold cache, repeat each state under comparable conditions before attributing the delay. Evaluate the user-visible time to complete the workflow, especially for jobs that respond immediately and perform the expensive work in the background.

Keep the same scenario for the permanent patch. When the operator confirms the patch is on the test host and the temporary shield has been removed under the change plan, repeat the scenario against that state. The same comparison format makes it easier to review both changes with the API and infrastructure owners.

FAQ

Does passing the Apidog scenario prove the mitigation works?

Passing confirms the API behaviors covered by your assertions on the tested host. Security reviewers still need independent evidence about the mitigation and the exact shield state. Use the API report to answer whether the tested client workflows stayed intact.

What if the baseline is red?

Resolve the baseline failure or document an existing issue and its reproduction conditions before drawing conclusions. If a fixture reset makes a baseline pass consistently, record that reset as part of both runs.

Should I compare the JSON reports byte for byte?

Compare test outcomes by stable case and assertion names. Keep differences in timestamps, generated IDs and scheduling noise visible in the raw reports. Flag missing steps and failed assertions explicitly in the summary.

Can the same suite check the permanent patch?

Yes. Run the same scenario on the patched staging service with the same fixtures. Record the application and host state so the reviewer can trace the results to the patch they intend to release.

Do health checks belong in this comparison?

Yes, as a quick readiness signal. Add at least one client workflow that reaches the affected service or worker and verifies the expected business result. A green health check tells you the endpoint responded. A completed import shows that the client got its result.

Top comments (0)