[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Policy Simulator for principal access boundary policies\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\n\u003cbr /\u003e\n\nPolicy Simulator for principal access boundary (PAB) policies lets you see how a\nchange to a [principal access boundary policy](/iam/docs/principal-access-boundary-policies) or [binding](/iam/docs/principal-access-boundary-policies#binding)\nmight affect your principals' access before you commit to making the change. You\ncan use Policy Simulator to help you understand the potential impact of\na change to a principal access boundary policy or binding before you apply it.\n\nThis feature only evaluates access based on principal access boundary policies and\npolicy bindings.\n\nTo learn how to simulate changes to other policy types, see the following:\n\n- [Policy Simulator for allow policies](/policy-intelligence/docs/iam-simulator-overview)\n- [Policy Simulator for deny policies](/policy-intelligence/docs/deny-simulator-overview)\n- [Policy Simulator for organization policies](/policy-intelligence/docs/test-organization-policies)\n\nHow Policy Simulator for principal access boundary policies works\n-----------------------------------------------------------------\n\nPolicy Simulator for principal access boundary policies helps you determine\nhow a change to a principal access boundary policy or policy binding affects access for\nprincipals in your organization.\n\nWhen you run a simulation for a principal access boundary policy or policy binding,\nPolicy Simulator does the following:\n\n- Reviews access logs from the organization that were generated during the\n [replay period](#replay-period) in the context of the current\n principal access boundary policies and bindings and the simulated principal access boundary\n policy or binding.\n\n- Returns a series of *access changes*. These access changes show which access\n attempts from the logs are likely to have different results if you applied\n the simulated policy or binding.\n\nTo learn more about the access changes that Policy Simulator returns,\nsee [Policy Simulator results](#review-results).\n\n### Replay period\n\nThe replay period is the time period that Policy Simulator gets access\nlogs for when running a simulation. Access logs that occur before the first day\nof the replay period or after the last day of the replay period aren't included\nin the simulation.\n\nTypically, the last day of the replay period is\n1 day prior to the simulation. However, in\nsome cases, the last day of the replay period can be\nup to 10 days prior to the simulation. Access logs\nthat occur after the last day of the replay period aren't included in the\nsimulation.\n\nThe replay period is 90 days. If the organization has not existed\nfor more than 90 days, then Policy Simulator retrieves all\naccess attempts since the organization was created.\n\nThe replay window is also [eventually consistent](https://en.wikipedia.org/wiki/Eventual_consistency). This\nmeans that, when you run a simulation, some data might be fresher than other\ndata. However, eventually, all the data will have the same freshness.\n\nPolicy Simulator results\n------------------------\n\nPolicy Simulator for principal access boundary reports the impact of a proposed\nchange to a\nprincipal access boundary policy or binding as a list of [access\nchanges](#access-changes). An access change represents an access attempt from\nthe replay period that would likely have a different result if the simulated\npolicy were applied.\n\nFor each access change, Policy Simulator also reports the following\ninformation:\n\n- The principal, permission, and, if available, resource involved in the access attempt.\n- The number of days during the replay period that the principal tried to use the permission to access the resource. This total includes only the access attempts that have the same result as the most recent access attempt.\n- The date of the most recent access attempt.\n\n### Access changes\n\nAn access change indicates that, based on the relevant principal access boundary\npolicies, a user's access is likely to change if you apply the simulated policy\nor binding. Access changes can either be *access gained* or *access revoked*.\n\nWhen calculating access changes, Policy Simulator for principal access boundary\nonly evaluates principal access boundary policies and bindings. It doesn't evaluate\nother policy types.\n\nPolicy Simulator calculates access changes using the following\ninformation:\n\n- The result of the most recent access attempt\n- The impact of the current principal access boundary policies and bindings\n- The impact of the proposed principal access boundary policies and bindings\n\nFor access to be *gained*, all of the following must be true:\n\n- The most recent access attempt was blocked\n- Access is blocked by the current principal access boundary policies and bindings\n- Access is not blocked by the proposed principal access boundary policies and bindings\n\nFor access to be *revoked*, all of the following must be true:\n\n- The most recent access attempt was not blocked\n- Access is not blocked by the current principal access boundary policies and bindings\n- Access is blocked by the proposed principal access boundary policies and bindings\n\nA set of principal access boundary policies and bindings block a principal's access if\n*all* of the following are true:\n\n- principal access boundary policies do affect the principal's access. In other words, the principal is subject to at least one principal access boundary policy that has an [enforcement\n version](/iam/docs/principal-access-boundary-policies#blocked-permissions) that supports the permission in the request.\n- None of the principal access boundary policies that the principal is subject to include the resource.\n\nA set of principal access boundary policies and bindings don't block principal's access\nif *any* of the following are true:\n\n- principal access boundary policies don't affect the principal's access. In other words, the principal isn't subject to any principal access boundary policies that that have an [enforcement\n version](/iam/docs/principal-access-boundary-policies#blocked-permissions) that supports the permission in the request.\n- At least one of the principal access boundary policies that the principal is subject to includes the resource.\n\nErrors\n------\n\nThe following errors can cause a simulation to fail:\n\n- **Timeout**: The simulation took too long to run and timed out. To resolve, try running the simulation again.\n- **Invalid simulation construction** : The proposed principal access boundary policy or principal access boundary policy binding is invalid. For example, the proposed policy has an invalid condition expression, or the proposed binding is for a principal set that is already bound to the [maximum number of\n policies](/iam/docs/principal-access-boundary-policies#binding). To resolve, correct the policy or binding and try again.\n- **Permission denied** : You don't have permission to run a simulation. To resolve, ensure that you're granted the [required roles](/policy-intelligence/docs/simulate-pab-policies#required-roles) and try again.\n\nSupported principal types\n-------------------------\n\nPolicy Simulator for principal access boundary policies only reviews access\nlogs for the following types of principals:\n\n- Google Accounts\n- Service accounts\n\nWhen simulating principal access boundary policies and bindings,\nPolicy Simulator doesn't review access logs for any other principal\ntypes. As a result, it doesn't report whether the proposed changes to your\npolicies or bindings will affect those principals' access.\n\nWhat's next\n-----------\n\n- Learn how to [simulate a change to a principal access boundary policy or binding](/policy-intelligence/docs/simulate-pab-policies).\n- Explore other [Policy Intelligence tools](/policy-intelligence/docs/overview)."]]