---
title: Bad advice loop termination counter
description: When a user has insufficient credentials to access a requested resource, AM can return policy advice that requires the user to authenticate at a higher level.
component: java-agents
version: 2025.11
page_id: java-agents:properties-reference:org.forgerock.agents.bad.advice.loop.termination.counter
canonical_url: https://docs.pingidentity.com/java-agents/2025.11/properties-reference/org.forgerock.agents.bad.advice.loop.termination.counter.html
---

# Bad advice loop termination counter

When a user has insufficient credentials to access a requested resource, AM can return policy advice that requires the user to authenticate at a higher level.

If there is an error in the AM configuration, an infinite authentication loop can occur, where the user is repeatedly asked to authenticate.

This property defines the maximum number of times the agent asks the user to authenticate before breaking a loop.

|                          |                                                                                                                                                                        |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Property name            | `org.forgerock.agents.bad.advice.loop.termination.counter`                                                                                                             |
| Aliases                  | `org.forgerock.agents.bad.advice.loop.termination.counter`   Introduced in Java Agent 2023.11   [Recognized](preface.html#how_am_manages_multiple_aliases) from AM 7.1 |
| Function                 | Bad configuration detection                                                                                                                                            |
| Type                     | Integer                                                                                                                                                                |
| Default                  | `5`                                                                                                                                                                    |
| Bootstrap property       | No                                                                                                                                                                     |
| Required property        | No                                                                                                                                                                     |
| Restart required         | No                                                                                                                                                                     |
| Local configuration file | `AgentConfig.properties`                                                                                                                                               |
