diff --git a/anchorecli/cli/image.py b/anchorecli/cli/image.py
index dbc1892..61c21f7 100644
--- a/anchorecli/cli/image.py
+++ b/anchorecli/cli/image.py
@@ -375,6 +375,10 @@ def delete(input_image, force, all):
                 if image['imageDigest']:
                     ret = anchorecli.clients.apiexternal.delete_image(config, imageDigest=image['imageDigest'], force=force)
                     if ret['success']:
+                        payload = ret.get('payload')
+                        if payload and payload.get('status') != 'deleting':
+                            raise Exception(payload.get('details'))
+
                         for image_detail in image['image_detail']:
                             fulltag = image_detail.pop('registry', "None") + "/" + image_detail.pop('repo', "None") + ":" + image_detail.pop('tag', "None")
                             print(fulltag)
@@ -401,7 +405,12 @@ def delete(input_image, force, all):
 
             if ret:
                 if ret['success']:
-                    print(anchorecli.cli.utils.format_output(config, 'image_delete', {}, ret['payload']))
+                    payload = ret.get('payload')
+                    if payload and payload.get('status') != 'deleting':
+                        ecode = 1  # backwards compatibility with pre v0.8.0 error
+                        raise Exception(payload.get('details', 'cannot delete image'))
+                    else:
+                        print(anchorecli.cli.utils.format_output(config, 'image_delete', {}, ret['payload']))
                 else:
                     raise Exception(json.dumps(ret['error'], indent=4))
             else:

Deleting an image reports success even if the image can't be deleted
Starting anchore-engine v0.8.0 image deletion is an async op and the response has changed to reflect this. The API always responds with 200 HTTP status unless the service is unable to respond. Status and details of the delete op are in the body of the response. anchore-cli does not currently parse the body, it simply keys off of the HTTP status to indicate whether the deletion attempt was successful
diff --git a/tests/unit/cli/test_image.py b/tests/unit/cli/test_image.py
index 7466974..00fc7e5 100644
--- a/tests/unit/cli/test_image.py
+++ b/tests/unit/cli/test_image.py
@@ -118,3 +118,70 @@ class TestQueryVuln:
         result = runner.invoke(image.query_vuln, ['centos/centos:8', 'all'])
         assert result.exit_code == 0
         assert item in result.stdout
+
+
+class TestDeleteImage:
+    def test_deleted_pre_v080(self, monkeypatch, response):
+        monkeypatch.setattr(image.anchorecli.cli.utils, 'discover_inputimage', lambda *a, **kw: (None, None, '<digest>'))
+        monkeypatch.setattr(image, 'config', {'jsonmode': False})
+        monkeypatch.setattr(image.anchorecli.clients.apiexternal, 'delete_image', lambda *a, **kw: {
+            'success': True,
+            'httpcode': 200,
+            'payload': {},
+            'error': {}
+        })
+        runner = CliRunner()
+        response(success=True)
+        result = runner.invoke(image.delete, ['centos/centos:8'])
+        assert result.exit_code == 0
+
+    def test_delete_failed_pre_v080(self, monkeypatch, response):
+        monkeypatch.setattr(image.anchorecli.cli.utils, 'discover_inputimage', lambda *a, **kw: (None, None, '<digest>'))
+        monkeypatch.setattr(image, 'config', {'jsonmode': False})
+        monkeypatch.setattr(image.anchorecli.clients.apiexternal, 'delete_image', lambda *a, **kw: {
+            'success': False,
+            'httpcode': 409,
+            'payload': {},
+            'error': 'cannot delete image'
+        })
+        runner = CliRunner()
+        response(success=True)
+        result = runner.invoke(image.delete, ['centos/centos:8'])
+        assert result.exit_code == 1
+
+    def test_is_deleting(self, monkeypatch, response):
+        monkeypatch.setattr(image.anchorecli.cli.utils, 'discover_inputimage', lambda *a, **kw: (None, None, '<digest>'))
+        monkeypatch.setattr(image, 'config', {'jsonmode': False})
+        monkeypatch.setattr(image.anchorecli.clients.apiexternal, 'delete_image', lambda *a, **kw: {
+            'success': True,
+            'httpcode': 200,
+            'payload': {
+                'detail': None,
+                'digest': '<digest>',
+                'status': 'deleting'
+            },
+            'error': {}
+        })
+        runner = CliRunner()
+        response(success=True)
+        result = runner.invoke(image.delete, ['centos/centos:8'])
+        assert result.exit_code == 0
+
+    def test_delete_failed(self, monkeypatch, response):
+        monkeypatch.setattr(image.anchorecli.cli.utils, 'discover_inputimage', lambda *a, **kw: (None, None, '<digest>'))
+        monkeypatch.setattr(image, 'config', {'jsonmode': False})
+        monkeypatch.setattr(image.anchorecli.clients.apiexternal, 'delete_image', lambda *a, **kw: {
+            'success': True,
+            'httpcode': 200,
+            'payload': {
+                'detail': 'cannot delete image',
+                'digest': '<digest>',
+                'status': 'delete_failed'
+            },
+            'error': {}
+        })
+        runner = CliRunner()
+        response(success=True)
+        result = runner.invoke(image.delete, ['centos/centos:8'])
+        assert result.exit_code == 1
+

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/anchore/anchore-cli.git@5cd4fa4783793ad50dfbc70dcb0709fbcd27009c#egg=anchorecli
attrs==22.2.0
certifi==2021.5.30
chardet==3.0.4
Click==7.0
coverage==6.2
execnet==1.9.0
idna==2.10
importlib-metadata==4.8.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
prettytable==0.7.2
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
python-dateutil==2.8.1
PyYAML==5.3.1
requests==2.23.0
six==1.14.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.25.8
zipp==3.6.0

name: anchore-cli
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - chardet==3.0.4
      - click==7.0
      - coverage==6.2
      - execnet==1.9.0
      - idna==2.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - packaging==21.3
      - pluggy==1.0.0
      - prettytable==0.7.2
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - python-dateutil==2.8.1
      - pyyaml==5.3.1
      - requests==2.23.0
      - six==1.14.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.25.8
      - zipp==3.6.0
prefix: /opt/conda/envs/anchore-cli

tests/unit/cli/test_image.py::TestDeleteImage::test_delete_failed
tests/unit/cli/test_image.py::TestQueryVuln::test_is_analyzing tests/unit/cli/test_image.py::TestQueryVuln::test_not_yet_analyzed tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Vulnerability tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Package] tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Severity] tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Fix] tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[CVE tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Type] tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Feed tests/unit/cli/test_image.py::TestQueryVuln::test_success_headers[Package tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[GHSA-7vvr-h4p5-m7fh] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[aubio-0.4.8] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[High] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[0.4.9] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[https://github.com/advisories/GHSA-7vvr-h4p5-m7fh] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[python] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[github:python] tests/unit/cli/test_image.py::TestQueryVuln::test_success_info[/usr/local/lib64/python3.6/site-packages/aubio] tests/unit/cli/test_image.py::TestDeleteImage::test_deleted_pre_v080 tests/unit/cli/test_image.py::TestDeleteImage::test_delete_failed_pre_v080 tests/unit/cli/test_image.py::TestDeleteImage::test_is_deleting
anchorecli/cli/image.py
anchorecli/cli/image.py